using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static string canConstruct(int[] a) { var sum = 0l; foreach(var val in a) { var strRep = val.ToString(); foreach(var c in strRep) { sum += int.Parse(c.ToString()); } } return sum % 3 == 0 ? "Yes" : "No"; } 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); } } }