#include using namespace std; //string canConstruct(vector a) { // Return "Yes" or "No" denoting whether you can construct the required number. //} int main() { int t; cin >> t; int r=0,a; 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; r=r+a%9; } //string result = canConstruct(a); if(r%3==0) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }