#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 i,j,k,x,y; x=0; for(int i = 0; i < n; i++){ cin >> a[i]; while(a[i]>0) { x=x+(a[i]%10); a[i]/=10; } } if(x%3==0){cout<<"Yes"<