using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static string canConstruct(string a) { // Return "Yes" or "No" denoting whether you can construct the required number. a = a.Replace(" ",""); var t = a.ToCharArray().Select(z=>Int32.Parse(z.ToString())).Sum(); if(t%3 == 0 ) return "Yes"; else return "No"; } static void Main(String[] args) { int t = Convert.ToInt32(Console.ReadLine()); string Inputs = ""; for(int a0 = 0; a0 < t; a0++){ int n = Convert.ToInt32(Console.ReadLine()); Inputs += Console.ReadLine(); string result = canConstruct(Inputs); Console.WriteLine(result); } } }