#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
#define MOD                 1000000007LL
#define EPS                 1e-9
#define io                  ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAXN = 1e5+5;

int main(){
	io;
	int t;
	cin >> t;
	while(t--){
		int n;
		cin >> n;
		ll sum = 0;
		for(int i = 0;i < n; i++){
			int x;
			cin >> x;
			sum += (ll)x;
		}
		if(sum % 3 == 0)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}