# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using D = double;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_num(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n;

string solve(){
	set<int> a, b;
	REP(i, 6) {
		int x;
		cin >> x;
		a.insert(x);
	}
	for (int i = 1; i <= 13; i++) {
		if (!a.count(i) && i != 7)b.insert(i);
	}
	if (a.count(1) && a.count(13))return "no";
	if (!a.count(1) && !a.count(13))return "yes";
	if (a.count(1)) {
		int l = 6, r = 8;
		int turn = 0;
		while (true) {
			if (turn % 2 == 0) {
				if (a.count(l)) {
					l--;
				}
				else if (a.count(r)) {
					r++;
				}
			}
			else {
				if (b.count(r)) {
					r++;
				}
				else if (b.count(l)) {
					l--;
				}
			}
			turn++;
			if (l == 0)return "yes";
			if (r == 14)return"no";
		}
	}
	else {
		int l = 6, r = 8;
		int turn = 0;
		while (true) {
			if (turn % 2 == 0) {
				if (a.count(r)) {
					r++;
				}
				else if (a.count(l)) {
					l--;
				}
			}
			else {
				if (b.count(l)) {
					l--;
				}
				else if (b.count(r)) {
					r++;
				}
			}
			turn++;
			if (r == 14)return "yes";
			if (l == 0)return"no";
		}
	}
}


int main() {
	cin >> n;
	REP(i, n) {
		cout << solve() << endl;
	}
}


Measured memory_bytes: 3188