#include using namespace std; int f(int n) { int ans = 0; while(n) { ans += n%10; n /= 10; } return ans; } int main() { // your code goes here int i, j, n, t; cin >> t; while(t--) { cin >> n; int x = 0; for(i = 1; i <= n; ++i) { cin >> j; x = (x + f(j)%3)%3; } if(x) cout << "No\n"; else cout << "Yes\n"; } return 0; }