//------------------------ Un, Deux, Trois, Quatre, Cinq -----------------------//
#include<bits/stdc++.h>
using namespace std;

//Shorthands
#define ll long long 
#define vll vector<ll>
#define vv vector<vll>
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pll pair<ll,ll>
#define vpll vector<pll>
#define ff first
#define ss second
#define tll tuple<ll,ll,ll>
#define vtll vector<tll> 
#define mt make_tuple
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define vect(a,n) vll a(n); rep(i,0,n) cin>>a[i];
#define all(a) a.begin(),a.end()
#define sortall(a) sort(a.begin(),a.end());

//Debug
#define printall(a) rep(i,0,a.size()) cout<<a[i]<<" "; cout<<endl;
#define pairout(p) cout<<"("<<p.ff<<","<<p.ss<<")  "<<endl;
#define watch(x) cout<<(#x)<<" is "<<x<<endl;

//Constants
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const ll mod = 998244353;

//Optimize
#pragma GCC optimize("Ofast")  
#pragma GCC target("avx,avx2,fma")
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"

//Input-Output File
void fileio(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif
}

//-------------------------- Six, Sept, Huit, Neuf, Dix ------------------------//


void solve()
{
    ll a,b,c; cin>>a>>b>>c;
    ll t=a+b+c;
    if(t%9==0 && a>=t/9 && b>=t/9 && c>=t/9) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

int main() 
{
    fastio;
    fileio();
    ll tc; cin>>tc; while(tc--)
    solve();
}
