#include using namespace std; using LL = long long; #define FOR(i, x, y) for (decay::type i = (x), _##i = (y); i < _##i; ++i) #define FORD(i, x, y) for (decay::type i = (x), _##i = (y); i > _##i; --i) #ifdef zerol #define dbg(args...) do { cout << "\033[32;1m" << #args<< " -> "; err(args); } while (0) #else #define dbg(...) #endif void err() { cout << "\033[39;0m" << endl; } template void err(T a, Args... args) { cout << a << ' '; err(args...); } // ----------------------------------------------------------------------------- int T, n, t; int main() { cin >> T; while (T--) { cin >> n; int ans = 0; FOR (_, 0, n) { cin >> t; ans += t % 3; } if (ans % 3 == 0) puts("Yes"); else puts("No"); } }