#include #include #include #include #include using namespace std; void solve() { int n; cin >> n; int total = 0; for (int i = 0; i< n; i++) { int x; cin >> x; while (x) { total = (total + x % 10) % 3; x /= 10; } } if (total == 0) cout <<"Yes\n" ;else cout << "No\n"; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int test;cin >> test; while (test--) solve(); return 0; }