#include "bits/stdc++.h" using namespace std; int main() { int tc;cin>>tc; while(tc--) { int n;cin>>n; int x=0; while(n--) { int a;cin>>a; x+=a;x%=3; } if(x)cout<< "No\n"; else cout<< "Yes\n"; } return 0; }