#include using namespace std; int main(){ int t; cin >> t; while(t--){ int n; cin >> n; int s = 0; while(n--){ int x; cin >> x; while(x){ s += x % 10; x /= 10; } } if(s % 3 == 0) cout << "Yes\n"; else cout << "No\n"; } }