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

#define F first
#define S second
#define endl "\n"
#define dbg(x) cout << (#x) << " is " << (x) << endl
#define scan(v,n) for(int zz=0;zz<n;zz++)cin>>v[zz]
#define scanp(v,n) for(int zz=0;zz<n;zz++)cin>>v[zz].F>>v[i].S 
#define show(v) for(int zzz=0;zzz<v.size();zzz++)cout<<v[zzz]<<" ";cout<<endl
#define showp(v) for(int zzz=0;zzz<v.size();zzz++)cout<<v[zzz].F<<" "<<v[zzz].S<<endl
#define precision(n) cout<<fixed<<setprecision(n)
#define lumos cout<<"boink"<<endl
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))
#define cntOne(x) __builtin_popcount(x)
#define ub upper_bound
#define lb lower_bound
#define mae *max_element
#define mie *min_element
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define forn(i,n) for(i=0;i<n;i++)
#define forr(i,e) for(i=e;i>=0;i--)
#define sortn(v) sort(all(v))
#define sortr(v) sort(rall(v))
#define IN(x) scanf("%d",&x)
#define INL(x) scanf("%lld",&x)
#define INC(x) scanf("%c",&x)
#define pf(x) printf("%d",x)
#define pfll(x) printf("%lld",x)
#define nl puts("")
#define spc <<" "<<
#define Spc <<" "
#define pb push_back
#define ppb pop_back
#define mP make_pair
#define pi acos(-1.0)
#define eps 1e-9
#define inf (1<31)
#define YN(yo,s1,s2) if(yo==true){cout<<s1<<endl;}else cout<<s2<<endl;
#define pfC(cas) printf("Case %d: ",cas)
#define set(n,pos) (n|(1<<pos))
#define check(n,pos) (n&(1<<pos))
#define gcd __gcd
#define Unique(v) sort(all(v));(v).resize(unique(all(v))-(v).begin())


typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef set<int> si;


const int N = 2e5+10;
const int mod = 1e9+7;


void solve(){
	ll n,m,i,j,k,l,r,p,x,y,z,a,b,c;

	cin>>a>>b>>c;

	ll mi=min(a,min(b,c));

	ll sum=(a+b+c);

	if(sum%9==0&&sum/9<=mi){
		cout<<"YES"<<endl;

	}else cout<<"NO"<<endl;
	


}

int main(){
	//ios_base::sync_with_stdio(false);cin.tie(0);


	int t;
	cin>>t;
	while(t--) solve();

}



### Prompt

Please formulate a CPP solution to 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
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define endl "\n"
#define dbg(x) cout << (#x) << " is " << (x) << endl
#define scan(v,n) for(int zz=0;zz<n;zz++)cin>>v[zz]
#define scanp(v,n) for(int zz=0;zz<n;zz++)cin>>v[zz].F>>v[i].S 
#define show(v) for(int zzz=0;zzz<v.size();zzz++)cout<<v[zzz]<<" ";cout<<endl
#define showp(v) for(int zzz=0;zzz<v.size();zzz++)cout<<v[zzz].F<<" "<<v[zzz].S<<endl
#define precision(n) cout<<fixed<<setprecision(n)
#define lumos cout<<"boink"<<endl
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))
#define cntOne(x) __builtin_popcount(x)
#define ub upper_bound
#define lb lower_bound
#define mae *max_element
#define mie *min_element
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define forn(i,n) for(i=0;i<n;i++)
#define forr(i,e) for(i=e;i>=0;i--)
#define sortn(v) sort(all(v))
#define sortr(v) sort(rall(v))
#define IN(x) scanf("%d",&x)
#define INL(x) scanf("%lld",&x)
#define INC(x) scanf("%c",&x)
#define pf(x) printf("%d",x)
#define pfll(x) printf("%lld",x)
#define nl puts("")
#define spc <<" "<<
#define Spc <<" "
#define pb push_back
#define ppb pop_back
#define mP make_pair
#define pi acos(-1.0)
#define eps 1e-9
#define inf (1<31)
#define YN(yo,s1,s2) if(yo==true){cout<<s1<<endl;}else cout<<s2<<endl;
#define pfC(cas) printf("Case %d: ",cas)
#define set(n,pos) (n|(1<<pos))
#define check(n,pos) (n&(1<<pos))
#define gcd __gcd
#define Unique(v) sort(all(v));(v).resize(unique(all(v))-(v).begin())


typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef set<int> si;


const int N = 2e5+10;
const int mod = 1e9+7;


void solve(){
	ll n,m,i,j,k,l,r,p,x,y,z,a,b,c;

	cin>>a>>b>>c;

	ll mi=min(a,min(b,c));

	ll sum=(a+b+c);

	if(sum%9==0&&sum/9<=mi){
		cout<<"YES"<<endl;

	}else cout<<"NO"<<endl;
	


}

int main(){
	//ios_base::sync_with_stdio(false);cin.tie(0);


	int t;
	cin>>t;
	while(t--) solve();

}



```