#include <iostream>
#include <cstdio>
using namespace std;

int t, a;
bool chk[14], ans[14][14][2], vis[14][14][2];

bool solve(bool type, int l, int r)
{
    if (vis[l][r][type])
        return ans[l][r][type];
    ans[l][r][type] = false;
    vis[l][r][type] = true;
    int cnt = 0;
    for (int i = 1; i <= 13; i++)
        if (i != 7 && (chk[i] ^ type) && l <= i && i <= r)
            cnt++;
    if (cnt == 6)
        return ans[l][r][type] = true;
    bool ope = false;
    if (l != 1 && (chk[l - 1] ^ type))
    {
        if (cnt == 5)
            return ans[l][r][type] = true;
        ans[l][r][type] |= (!solve(type ^ 1, l - 1, r));
        ope = true;
    }
    if (r != 13 && (chk[r + 1] ^ type))
    {
        if (cnt == 5)
            return ans[l][r][type] = true;
        ans[l][r][type] |= (!solve(type ^ 1, l, r + 1));
        ope = true;
    }
    if (!ope)
        ans[l][r][type] |= (!solve(type ^ 1, l, r));
    return ans[l][r][type];
}

int main()
{
    scanf("%d", &t);
    while (t--)
    {
        for (int i = 0; i < 14; i++)
        {
            chk[i] = false;
            for (int j = 0; j < 14; j++)
                vis[i][j][0] = vis[i][j][1] = false;
        }
        for (int i = 0; i < 6; i++)
        {
            scanf("%d", &a);
            chk[a] = true;
        }
        printf("%s\n", (solve(false, 7, 7) ? "yes" : "no"));
    }
}

