using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static string canConstruct(int[] a) { int test = 0; int lng = a.Length; for (int i = 0; i < lng; i++){ test = test + (a[i] % 3); test = test % 3; } if (test == 0){ return "Yes"; } else { return "No"; } // Return "Yes" or "No" denoting whether you can construct the required number. } static void Main(String[] args) { int t = Convert.ToInt32(Console.ReadLine()); for(int a0 = 0; a0 < t; a0++){ int n = Convert.ToInt32(Console.ReadLine()); string[] a_temp = Console.ReadLine().Split(' '); int[] a = Array.ConvertAll(a_temp,Int32.Parse); string result = canConstruct(a); Console.WriteLine(result); } } }