#include using namespace std; string canConstruct(vector a) { // Return "Yes" or "No" denoting whether you can construct the required number. //find out if one of the digits is divisible by 3 int digits = 1; int test = 0; for (int i = 0; i < a.size(); i++) { if (a[i] % 3 == 0) { return "Yes"; } test = a[i]; while (test > 10) { test /= 10; digits++; if ((a[i]/(10^digits)) % 3 == 0) { return "Yes"; } } } return "No"; } int main() { int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } string result = canConstruct(a); cout << result << endl; } return 0; }