#include using namespace std; int main() { int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int n,ans = 0; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ ans = 0; cin >> a[a_i]; int t = a[a_i]; while(t){ ans +=t%10; t/=10; } } if(!(ans%3)) cout<<"Yes\n"; else cout<<"No\n"; //string result = canConstruct(a); } return 0; }