#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; for(int e=0;e>n; int i; long long int x,s=0; for(i=0;i>x; while(x>0) { s=s+x%10; x=x/10; } } if(s%3==0) cout<<"Yes\n"; else cout<<"No\n"; } return 0; }