#include using namespace std; #define f first #define s second #define pb push_back #define all(x) x.begin(), x.end() using LL = long long; using pii = pair ; using vii = vector ; const int INF = INT_MAX; const int MOD = 1e9 + 7; const int N = 1e5 + 5; int f(int n) { int res = 0; while(n) { res += n % 10; n /= 10; } return res; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin>>t; while(t--) { int n; cin>>n; int sum = 0; while(n--) { int x; cin>>x; sum += f(x); } cout<<(sum % 3 == 0 ? "Yes\n" : "No\n"); } return 0; }