using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static string canConstruct(int[] a) { // Return "Yes" or "No" denoting whether you can construct the required number. bool found = false; foreach (int item in a) { if (item % 3 == 0) { found = true; break; } else { found = false; int k = item; while (k > 0) { int rem = k % 10; if (rem % 3 == 0) { found = true; break; } k = k / 10; } if (found == true) { break; } } } if (found == true) { return "Yes"; } else { return "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); } } }