#include<iostream>
#include<vector>
using namespace std;
int n; vector<int>a, b;
int solve(vector<int> p, vector<int> q, int L, int R) {
	if (q.size() == 0)return 0;
	int M1 = L - 1, M2 = R + 1;
	int S[4] = { 0,0,0,0 };
	vector<int>p1; bool flag = false;
	for (int i = 0; i < p.size(); i++) {
		if (M1 != p[i])p1.push_back(p[i]);
	}
	if (p1.size() != p.size()) { flag = true; S[solve(q, p1, L - 1, R)] = 1; }
	p1.clear();
	for (int i = 0; i < p.size(); i++) {
		if (M2 != p[i])p1.push_back(p[i]);
	}
	if (p1.size() != p.size()) { flag = true; S[solve(q, p1, L, R + 1)] = 1; }
	if (flag == false) { S[solve(q, p, L, R)] = 1; }
	for (int i = 0; i < 4; i++) {
		if (S[i] == 0)return i;
	}
	return 4;
}
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		a.clear(); b.clear();
		for (int j = 0; j < 6; j++) { int c; cin >> c; a.push_back(c); }
		for (int j = 1; j <= 13; j++) {
			bool flag = true; if (j == 7)flag = false;
			for (int k = 0; k < 6; k++) { if (a[k] == j)flag = false; }
			if (flag == true)b.push_back(j);
		}
		int E = solve(a, b, 7, 7);
		if (E == 0)cout << "no" << endl;
		else cout << "yes" << endl;
	}
	return 0;
}