#include using namespace std; int main() { int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int n; cin >> n; vector a(n); int e; cin >> e; if(e%3==0) {cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }