#include using namespace std; int main() { int tests; cin >> tests; int N; while(cin >> N) { int total = 0; for(int i=0; i> temp; while(temp) { total += temp % 10; temp /= 10; } } cout << (total % 3 == 0 ? "Yes" : "No") << endl; } }