#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< long long > vll;
typedef pair< int,int > ii;
typedef long long ll;
#define sz(a) int((a).size())
#define pb push_back
#define mp  make_pair
#define mod 1000000007
#define mod2 998244353
#define all(c) c.begin(),c.end()
#define tr(c,i) for(typeof(c).begin() i = c.begin(); i != c.end(); i++)
#define present(c,x) (c.find(x) != c.end())
#define cpresent(c,x) (find(all(c),x) != c.end())
#define rep(i, a, b) for (int i = (a); i <= int(b); i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define fo(i,n) for(ll i=0;i<n;i++)
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define Yes cout<<"Yes\n"
#define No cout<<"No\n"
#define nl "\n"
#define F first
#define S second 
#define eps 0.0000001
typedef long double ld;


void ipgraph(int n, int m);
//void dfs(int u, int par);
ll gcd (ll a, ll b);
unsigned long long factorial[2000007]; 
//___________________________________________
 unsigned long long power(unsigned long long x,long long y,int p)
{unsigned long long res=1;x=x%p;while(y>0){if(y&1)
res=(res*x)%p;y=y>>1;x=(x*x)%p;}
return res;}
//__________________________________________
unsigned long long modInverse(unsigned long long n,int p)
{return power(n,p-2,p);}
//_____________________________________________
unsigned long long nc(unsigned long long n,int r,int p)
{if(r==0)
return 1;return(factorial[n]*modInverse(factorial[r],p)%p*modInverse(factorial[n-r],p)%p)%p;}
// int fa[200005];
// int find(int x){if(fa[x]==x)return x;fa[x]=find(fa[x]);return fa[x];}
//set<int> s[300005];
vll f1(100005),f2(100005);






vi g[200004];
/*vi col(200004);
vi d(200004);
vi p(200004);
vi l(200004);
int cs=-1;
int ct=-1;

bool dfs(int u,int v){
    col[u]=1;
    for(int i : g[u]){
        if(i!=v){
            if(col[i]==0){
                p[i]=u;
                if(dfs(i,p[i])){
                    return true;
                }
            }
            else{
                cs = u;
                ct = i;
                return true;
            }
        }
      
    }
    col[u]=2;
    return false;
}*/


/*bool f=1;
void bfs(int u,int n){
  
    queue<int> q;
    q.push(u);
    l[u]=0;
    d[u]=0;
    col[u]=1;
    while(!q.empty()){
        int v = q.front();
        q.pop();
        for(int i: g[v]){
            if(col[i]==0){
                d[i]= d[v]+1;
                p[i]=v;
                col[i]=1;
                l[i]= (l[v]^1);
                q.push(i);

            }
            else{
                f = f&(l[i]!=l[v]);
            }
        }
        
        col[v]=2;

    }
}*/

void deb(int x , string s){
    cout<<x<<" "<<s<<nl;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE 
    freopen("input.txt", "r", stdin); 
    freopen("output.txt", "w", stdout); 
    #endif
    int t=1;
    
    cin>>t;
    while(t--){
        ll a,b,c;
        cin>>a>>b>>c;
        ll s = a+b+c;
        if(s%9!=0){
            NO;
        }
        else{
            ll p = s/9;
            if(a>=p && b>=p && c>=p){
                YES;
            }
            else{
                NO;
            }
        }
        
      
      
        


    }
    
       
    return 0;
}



ll gcd(ll a, ll b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
    u--, v--;
		g[u].pb(v);
		g[v].pb(u);
	}
}

    /*factorial[0] = 1; 
for (int i = 1; i <= 100004; i++) {
    factorial[i] = (factorial[i - 1] * i) % mod; 
}*/
