#include #include #include #include #include #include using namespace std; typedef long long LL; typedef vector VI; #define REP(i,n) for(int i=0, i##_len=(n); i inline void amin(T &x, const T &y) { if (y inline void amax(T &x, const T &y) { if (x void rprintf(const char *fmt, Iter begin, Iter end) { for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); } putchar('\n'); } void MAIN() { int N; scanf("%d", &N); int s = 0, x = 0; REP (i, N) { scanf("%d", &x); s += x; s %= 3; } puts(s == 0? "Yes": "No"); } int main() { int TC = 1; scanf("%d", &TC); REP (tc, TC) MAIN(); return 0; }