#include using namespace std; #define ll long long int #define inf 1000000000000 #define mod 1000000007 #define pb push_back #define mp make_pair #define all(v) v.begin(),v.end() #define S second #define F first #define boost1 ios::sync_with_stdio(false); #define boost2 cin.tie(0); #define ict int t;cin>>t;while(t--) int main() { /*#ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif*/ boost1 boost2 ict { int n; cin>>n; ll ans=0; int a[n]; for(int i=0;i>a[i]; while(a[i]) ans+=a[i]%10,a[i]/=10; } (ans%3==0)?cout<<"Yes":cout<<"No"; cout<