#include // PLEASE using namespace std; typedef long long ll; typedef pair pp; #define MAXN 300005 #define MAXM 1005 #define MAXP 25 #define A first #define B second #define MP make_pair #define PB push_back const ll INF = 2e9+13; const ll MOD = 1e9+7; int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); int T, N; cin >> T; while(T--) { cin >> N; int x; ll sum = 0; for(int i=0; i> x; sum += (ll)x; } if(sum%3) cout << "No" << endl; else cout << "Yes" << endl; } }