//IaMaNanBord//

#include <bits/stdc++.h>
using namespace std;

//Macro Shorthands
#define F                       first
#define S                       second
#define f(i,n)                  for(ll i=0;i<=n;i++)
#define rf(i,n)                 for(ll i=n;i>=0;i--)
#define Cf(i,a,b)               for(ll i=a;i<=b;i++)
#define Crf(i,b,a)              for(ll i=b;i>=a;i--)
// #define endl                    '\n'           
#define pb                      push_back
#define mp                      make_pair
#define z                       ((ll)1e9 + 7)  
#define every(it,x)             for(auto &it:x)
#define SET(it,x)               for(auto &it:x){cin>>it;}
#define ins                     insert
#define INF						((ll)1e18)
#define Test                    ll T; cin>>T; while(T--)
#define all(v)                  v.begin(),v.end()
#define nline                   cout<<endl
#define SZ(v)                   (ll)v.size()
#define pll                     pair<ll,ll>  
 
//Macro Shorthands
#ifndef ONLINE_JUDGE
    #define revelio(args...)        { string _s = #args; replace(_s.begin(), _s.end(), ',', ' ');stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#else
    #define revelio(args...)        {}
#endif

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {cerr << *it << " = " << a << endl; err(++it, args...);}

//Data types
typedef long long               ll;
typedef vector<ll>              vll;
typedef vector<string>          vstr;
typedef vector<char>            vchar;
typedef vector<pair<ll,ll> >    vpll;
typedef set<ll>                 sll;
typedef set<string>             sstr;
typedef set<pair<ll,ll> >       spll;
typedef map<ll,ll>              mllll;
typedef map<string,ll>          mstrll;
typedef queue<ll>               qll;


//Functions
ll powMod(ll x,ll y)            {ll p=1; while(y){if(y%2){p=(p*x)%z;} y/=2; x=(x*x)%z;} return p;}
ll CpowMod(ll x,ll y, ll w)     {ll p=1; while(y){if(y%2){p=(p*x)%w;} y/=2; x=(x*x)%w;}return p;}
ll invMod(ll x)                 {return powMod(x,z-2);}
ll CinvMod(ll x,ll w)           {return CpowMod(x,w-2,w);}
ll gcd(ll a, ll b)              {return b == 0 ? a : gcd(b, a % b);}
// ll exGcd(ll a,ll b,ll &x, ll &y){if(b==0){y = 0;x = 1;return a;}ll xtmp, ytmp;ll g = exGcd(b,a%b,xtmp,ytmp);
//                                 x=ytmp; y = xtmp - (a/b)*ytmp;return g;}
// vll sub;
// void subSet(ll k,ll n)          {if(k==n+1){every(it,sub)cout<<it<<" ";cout<<endl;}
//                                 else{sub.pb(k);subSet(k+1,n);
//                                 sub.pop_back();subSet(k+1,n);}}

// vll perm; const ll N = (ll)2e6 ;bool isSelected[N];
// void permut(ll n)               {if(perm.size()==n){every(it,perm)cout<<it<<" ";cout<<endl;}
//                                 else{Cf(i,1,n){if(isSelected[i])continue;perm.pb(i);
//                                 isSelected[i]=1;permut(n);perm.pop_back();isSelected[i] =0;}}} 

void solve(){
    Test{
        vll a(3);
        SET(it,a);
        sort(all(a));
        ll sum = a[0] + a[1] + a[2];
        if(sum%9){
            cout<<"NO"<<endl;
        }
        else{
            ll x = sum/9;
            if(x>a[0]){
                cout<<"NO"<<endl;
            }
            else{
                cout<<"YES"<<endl;
            }
        }
    }
}


int main(){
    ios_base::sync_with_stdio(0) ;
    cin.tie(0) ; cout.tie(0) ;
    cout.precision(20);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	freopen("error.txt","w",stderr);
    #else
    
    #endif
    solve();
    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed: "<<1.0*clock()/ CLOCKS_PER_SEC<<" Sec\n";
    #endif
    return 0;
}

### Prompt

Create a solution in cpp for the following problem:

You are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of them has a health points, the second has b health points, and the third has c.

To kill the monsters, you can use a cannon that, when fired, deals 1 damage to the selected monster. Every 7-th (i. e. shots with numbers 7, 14, 21 etc.) cannon shot is enhanced and deals 1 damage to all monsters, not just one of them. If some monster's current amount of health points is 0, it can't be targeted by a regular shot and does not receive damage from an enhanced shot.

You want to pass the dungeon beautifully, i. e., kill all the monsters with the same enhanced shot (i. e. after some enhanced shot, the health points of each of the monsters should become equal to 0 for the first time). Each shot must hit a monster, i. e. each shot deals damage to at least one monster.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of test cases.

Each test case consists of a single line that contains three integers a, b and c (1 ≤ a, b, c ≤ 10^8) — the number of health points each monster has.

Output

For each test case, print YES if you can kill all the monsters with the same enhanced shot. Otherwise, print NO. You may print each letter in any case (for example, YES, Yes, yes, yEs will all be recognized as positive answer).

Example

Input


3
3 2 4
1 1 1
10 1 7


Output


YES
NO
NO

Note

In the first test case, you can do as follows: 1-th shot to the first monster, 2-th shot to the second monster, 3-th shot to the third monster, 4-th shot to the first monster, 5-th shot to the third monster, 6-th shot to the third monster, and 7-th enhanced shot will kill all the monsters.

In the second test case, you can't kill monsters with the same enhanced shot, because the total number of health points of monsters is 3, and you will kill them in the first 3 shots.

### Response

```cpp
//IaMaNanBord//

#include <bits/stdc++.h>
using namespace std;

//Macro Shorthands
#define F                       first
#define S                       second
#define f(i,n)                  for(ll i=0;i<=n;i++)
#define rf(i,n)                 for(ll i=n;i>=0;i--)
#define Cf(i,a,b)               for(ll i=a;i<=b;i++)
#define Crf(i,b,a)              for(ll i=b;i>=a;i--)
// #define endl                    '\n'           
#define pb                      push_back
#define mp                      make_pair
#define z                       ((ll)1e9 + 7)  
#define every(it,x)             for(auto &it:x)
#define SET(it,x)               for(auto &it:x){cin>>it;}
#define ins                     insert
#define INF						((ll)1e18)
#define Test                    ll T; cin>>T; while(T--)
#define all(v)                  v.begin(),v.end()
#define nline                   cout<<endl
#define SZ(v)                   (ll)v.size()
#define pll                     pair<ll,ll>  
 
//Macro Shorthands
#ifndef ONLINE_JUDGE
    #define revelio(args...)        { string _s = #args; replace(_s.begin(), _s.end(), ',', ' ');stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#else
    #define revelio(args...)        {}
#endif

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {cerr << *it << " = " << a << endl; err(++it, args...);}

//Data types
typedef long long               ll;
typedef vector<ll>              vll;
typedef vector<string>          vstr;
typedef vector<char>            vchar;
typedef vector<pair<ll,ll> >    vpll;
typedef set<ll>                 sll;
typedef set<string>             sstr;
typedef set<pair<ll,ll> >       spll;
typedef map<ll,ll>              mllll;
typedef map<string,ll>          mstrll;
typedef queue<ll>               qll;


//Functions
ll powMod(ll x,ll y)            {ll p=1; while(y){if(y%2){p=(p*x)%z;} y/=2; x=(x*x)%z;} return p;}
ll CpowMod(ll x,ll y, ll w)     {ll p=1; while(y){if(y%2){p=(p*x)%w;} y/=2; x=(x*x)%w;}return p;}
ll invMod(ll x)                 {return powMod(x,z-2);}
ll CinvMod(ll x,ll w)           {return CpowMod(x,w-2,w);}
ll gcd(ll a, ll b)              {return b == 0 ? a : gcd(b, a % b);}
// ll exGcd(ll a,ll b,ll &x, ll &y){if(b==0){y = 0;x = 1;return a;}ll xtmp, ytmp;ll g = exGcd(b,a%b,xtmp,ytmp);
//                                 x=ytmp; y = xtmp - (a/b)*ytmp;return g;}
// vll sub;
// void subSet(ll k,ll n)          {if(k==n+1){every(it,sub)cout<<it<<" ";cout<<endl;}
//                                 else{sub.pb(k);subSet(k+1,n);
//                                 sub.pop_back();subSet(k+1,n);}}

// vll perm; const ll N = (ll)2e6 ;bool isSelected[N];
// void permut(ll n)               {if(perm.size()==n){every(it,perm)cout<<it<<" ";cout<<endl;}
//                                 else{Cf(i,1,n){if(isSelected[i])continue;perm.pb(i);
//                                 isSelected[i]=1;permut(n);perm.pop_back();isSelected[i] =0;}}} 

void solve(){
    Test{
        vll a(3);
        SET(it,a);
        sort(all(a));
        ll sum = a[0] + a[1] + a[2];
        if(sum%9){
            cout<<"NO"<<endl;
        }
        else{
            ll x = sum/9;
            if(x>a[0]){
                cout<<"NO"<<endl;
            }
            else{
                cout<<"YES"<<endl;
            }
        }
    }
}


int main(){
    ios_base::sync_with_stdio(0) ;
    cin.tie(0) ; cout.tie(0) ;
    cout.precision(20);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	freopen("error.txt","w",stderr);
    #else
    
    #endif
    solve();
    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed: "<<1.0*clock()/ CLOCKS_PER_SEC<<" Sec\n";
    #endif
    return 0;
}

```