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

int main(){
    ll t; cin >> t;
    while(t--){
        ll a, b, c; cin >> a >> b >> c;
        if((a+b+c)/9<=min(a,min(b,c)) && (a+b+c)%9==0) cout << "Yes" << "\n";
        else cout << "No\n";
    }
}
