#include #include #include #include #include using namespace std; int main() { int t; cin>>t; for(int i=0;i>n; int sum=0; vector d; for(int i=0;i>y; if(y%10!=0) { int r=0; while(y!=0) { int x=y%10; r=r+x; y=y/10; } sum=sum+r; } else { sum=sum+y; } } if(sum%3==0) cout<<"Yes"<<"\n"; else cout<<"No"<<"\n"; } return 0; }