#include using namespace std; string canConstruct(vector a) { // Return "Yes" or "No" denoting whether you can construct the required number. int total = 0, tmp; for (int i = 0; i < a.size(); ++i) { tmp = a[i]; while (tmp) { total += tmp % 10; tmp /= 10; } } if (total % 3) return "No"; else return "Yes"; } int main() { int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } string result = canConstruct(a); cout << result << endl; } return 0; }