#include using namespace std; typedef long long ll; ll ds(ll n) { ll res=0; while(n) { res+=n%10; n/=10; } return res; } string canConstruct(vector a) { ll res=0; for(auto x:a) { res+=ds(x); } if(res%3==0) return "Yes"; else 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; }