#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;

const int OO = 1e7;

#define lp(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
#define MOD 1000000007
#define nl '\n'
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template<typename T>
void print(const vector<T> &v) {
    for (auto &i : v)
        cout << i << " ";
    cout << nl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ///freopen("shops.in", "r", stdin);
    ///freopen('output3.txt', 'w', stdout);
    int t;
    cin >> t;
    while (t--) {
        ll a, b, c;
        cin >> a >> b >> c;
        ll sum = a + b + c;
        ll enh = sum / 9;
        if (sum % 9 == 0 && a >= enh && b >= enh && c >= enh)
            cout << "YES" << nl;
        else
            cout << "NO" << nl;
    }
    return 0;
}