#include #include #include #include #include using namespace std; int sum_digits(int n) { int total = 0; string s = to_string(n); for (char c : s) { total += c - '0'; } return total; } int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int n; cin >> n; vector v(n); for (int& j : v) { cin >> j; } int total_digits = 0; for (int j : v) { total_digits += sum_digits(j); } if (total_digits % 3 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }