#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int t; cin>>t; while(t--) { int n; cin>>n; int s=0,x; while(n--) { scanf("%d",&x); while(x) { s=s+x%10; x/=10; } } if(s%3==0) cout<<"Yes\n"; else cout<<"No\n"; } return 0; }