#include #define boost std::ios::sync_with_stdio(false) using namespace std; #define ll long long #define pb push_back int power(ll x, ll y) { ll res = 1; // Initialize result while (y > 0) { // If y is odd, multiply x with result if (y & 1) res = (res*x); // n must be even now y = y>>1; // y = y/2 x = x*x; // Change x to x^2 } return res; } set S; void subArray(int arr[], int n) { // Pick starting point for (int i=1; i <=n; i++) { // Pick ending point for (int j=0; j map1; for (int k=j; k ::iterator it=map1.begin(); it!=map1.end(); ++it) { } //cout << arr[k] << " "; cout << endl; } } } int main() { boost; ll t; cin>>t; while (t--) { ll n; cin>>n; ll a,sum=0; for (int i = 0; i < n; ++i) { cin>>a; sum=sum+a; } if(sum%3==0) cout<<"Yes\n"; else cout<<"No\n"; } return 0; }