#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c;
        cin>>a>>b>>c;
        int sum=a+b+c;
        if(sum<7)
            cout<<"No"<<endl;
        else
        {
            if(sum%9==0)
            {
                sum=sum/9;
                if(a>=sum && b>=sum && c>=sum)
                    cout<<"Yes"<<endl;
                else
                    cout<<"No"<<endl;
            }
            else
                cout<<"No"<<endl;
        }
    }
    return 0;
}
