#include using namespace std; string canConstruct(vector a,int n) { // Return "Yes" or "No" denoting whether you can construct the required number. int sum=0,remainder,t; for(int a_i = 0; a_i < n; a_i++) { t=a[a_i]; while (t != 0) { remainder = t % 10; sum = sum + remainder; t = t / 10; } } if(sum%3==0) return "Yes"; else return "No"; } int main() { int t; cin >> t; int n; for(int a0 = 0; a0 < t; a0++){ cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } string result = canConstruct(a,n); cout << result << endl; } return 0; }