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