#include<bits/stdc++.h>
using namespace std;
 
int main()
{
    int t;cin>>t;
    while(t--)
    {
        
        int a[3];
        int res=0;
        for(int i=0;i<3;i++) {cin>>a[i];res+=(a[i]);}
        int k=res/9;
        if(res%9==0 && a[0]>=k && a[1]>=k && a[2]>=k) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}
