#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

int n;
int g[13];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> n;

	for (int k = 0;k < n;k++){
		int tmp;
		fill(g,g+13,2);
		g[6] = 3;
		for (int i = 0;i < 6;i++){
			cin >> tmp;
			g[tmp-1] = 1; 
		}	
		if(g[0] == 1 && g[12] == 1) cout << "no" << endl;
		else if(g[0] == 2 && g[12] == 2) cout << "yes" << endl;
		else if(g[0] == 1){
			int t = 0;
			int a = 6, b = 6;
			while(true){
				if(t%2 == 0){
					if(g[a-1] == 1){
						g[a-1] = 3; a--;
					}else if(g[b+1] == 1){
						g[b+1] = 3; b++;
					}
				}else{
					if(g[b+1] == 2){
						g[b+1] = 3; b++;
					}else if(g[a-1] == 2){
						g[a-1] = 3; a--;
					}
				}
				if(a == 0){cout << "yes" << endl; break;}
				if(b == 12){cout << "no" << endl; break;}
				t++;
			}
		}else if(g[0] == 2){
			int t = 0;
			int a = 6, b = 6;
			while(true){
				if(t%2 == 0){
					if(g[b+1] == 1){
						g[b+1] = 3; b++;
					}else if(g[a-1] == 1){
						g[a-1] = 3; a--;
					}
				}else{
					if(g[a-1] == 2){
						g[a-1] = 3; a--;
					}else if(g[b+1] == 2){
						g[b+1] = 3; b++;
					}
				}
				if(a == 0){cout << "no" << endl; break;}
				if(b == 12){cout << "yes" << endl; break;}
				t++;
			}
		}
	}

	return 0;

}

