#include #define ll long long int #define mod 1000000007 #define fori(i,a,b) for(long long int i=a;i<=b;++i) #define pb push_back #define F first #define S second #define boost ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0) using namespace std; const ll N=2e5+5l; int main() { boost; //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int t; cin>>t; while(t--) { int n; cin>>n; ll a[n+5]; for(int i=0;i>a[i]; } int ans=0; for(int i=0;i0) { ans+=z%10; z/=10; } } if(ans%3==0) { cout<<"Yes"<