#include using namespace std; const int INF = 1e9 + 9; int t, n, x; int sum = 0; void myPartition(int x){ while (x > 0){ sum += x%10; x/=10; } return; } int main(){ //freopen ("input.txt", "r", stdin); //freopen ("output.txt", "w", stdout); scanf ("%d", &t); while (t--){ scanf ("%d", &n); sum = 0; for (int i = 0; i < n; i++){ scanf ("%d", &x); myPartition(x); } if (sum % 3 == 0) printf ("Yes\n"); else printf ("No\n"); } return 0; }