/**
 * \author KienNguyen246
 * \date 17/12/2020
 */

///😭😢😞☹🙁😐🙂☺😊😁😀😆😂🤣

 ///----------------🤔🤔🤔 -----------------///

/**< 🤣🤣🤣 */
#include <bits/stdc++.h>

///TLE (in case of emergency)
#define TLE 0
#if TLE
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#endif // TLE

#define NOT_INTERACTIVE 1

using namespace std;

typedef long long ll;
typedef double db;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

//const int maxn = 105;
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
const int infi = (2e9 + 69);
const ll infy = (2e16 + 69);
const int base = 311;
const ll MM = 7ll * mod * mod;
const int addition = 1e5;
const db eps = 1e-8;
const string numd[10] = {"1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"};
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};
const double pi = 3.14159265358980;
const string P1 = "Ashish";
const string P2 = "Utkarsh";
const string spmcode = "My power does not end. Ask for aid and you will receive it.\n";

template <typename Num> void maximize(Num &x, Num y) {x = mx(x, y);}
template <typename Num> void minimize(Num &x, Num y) {x = min(x, y);}
void exit_with_runtime() {db x = 1.0 * clock() / CLOCKS_PER_SEC; cerr << "\n\n---------------------\nTime elapsed: " << x << " s.\n\n"; exit(0);}
void decorate() {cerr << "KienNguyen246\n"; chrono:: system_clock::time_point today = chrono::system_clock::now(); time_t tt = chrono::system_clock::to_time_t(today); cerr << ctime(&tt); cerr << "\nProcessing...\n\n";}

///Multiple tests?
#define MUL_TEST 1

/**< 🤣🤣🤣 */

//bool Palin(string s) {string r = s; reverse(whole(r)); return (r == s);}

/* 🙃🙃🙃 */
int n;

//My power does not end. Ask for aid and you will receive it.
void Main_Process()
{
    int a, b, c;
    cin >> a >> b >> c;
    if ((a + b + c) % 9 == 0)
    {
        int t = 7 * (a + b + c) / 9;
        int a1 = a - t / 7;
        int b1 = b - t / 7;
        int c1 = c - t / 7;
        if (a1 >= 0 && b1 >= 0 && c1 >= 0) cout << "YES\n";
        else cout << "NO\n";
    }
    else cout << "NO\n";
}

/**< 😂😂😂 */
int main()
{
    /**< Main preprocessing begin */
    ios_base::sync_with_stdio(0);

#if NOT_INTERACTIVE
//    cin.tie(0); cout.tie(0);
    decorate();
#endif

#ifndef ONLINE_JUDGE
    freopen(".inp", "r", stdin);
//        freopen(".out", "w", stdout);
#endif
    /**< Main preprocessing end */
    /*😍😍😍*/
    int test = 1;
    cerr << spmcode << "\n";

    #if MUL_TEST
        cin >> test;
    #endif
    while (test --) Main_Process();
    exit_with_runtime();
}
/**< 😂😂😂 */
///😂😂😂😂😂😂😂😂🌚🔥😂😂😂😂🌚🔥😂😂🔥😂😂😂🔥😂😂😂🔥😂💯💯💯💯💩🐸🔥😂🔥😂🔥💩🔥🔥😂🌚💯🐸💯💩🐸🔥🔥💞🔥💩💩💩💞😂😂😂😂😂😂😂💞💞😂😂😂💞🔥🔥💞💯💩💞💯💞😂😂😂💞💩💩💩💩💩💩💞💩💩💩💩💩💩💩💩💞🔥🔥😂💞🔥😂😂💞
