#include using namespace std; string canConstruct(vector a) { // Return "Yes" or "No" denoting whether you can construct the required number. int len = a.size(); long long int sum = 0; int temp; for(int i = 0; i < len; i++) { int temp = a[i]; while(temp) { sum += temp %10; temp /= 10; } } return sum % 3 == 0 ? "Yes" : "No"; } 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; }