#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define eraser(v,i) (v).erase(v.begin()+(i))
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
typedef pair< int , int> P;
int num[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
bool uru(int checkyear){
  if(checkyear%4==0){
    if(checkyear%100!=0||checkyear%400==0)
    return true;
  }
  return false;
}
int gcd( int x, int y ){return y ? gcd(y, x%y) : x;}
bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.second!= secondElof.second)    return firstElof.second> secondElof.second;
  else return firstElof.first< secondElof.first;
}
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
int a=0,b=0;
bool player1 = false,player2=false;
std::cin >> x;
rep(i,x){
  a=7;
  b=7;
  n=0;
  m=0;
  std::vector<int> v(6);
  std::vector<int> v2(6);
  std::cin >> v[0]>>v[1]>>v[2]>>v[3]>>v[4]>>v[5];
  sort(all(v));
  repone(i,14){
    if(i==7)continue;
    if(v[n]==i){
      n++;
    }else{
      v2[m]=i;
      m++;
    }
  }
  if(v[0]==1&&v[5]==13)std::cout << "no" << '\n';
  else if(v[0]!=1&&v[5]!=13)std::cout << "yes" << '\n';
  else if(v[0]==1){
    for(;;){
      for(int i=0;i<v.size();i++){
        if(v[i]==a-1){
          a--;
          eraser(v,i);
          player1=true;
          break;
        }
      }
      if(!player1){
        for(int i=v.size()-1;i>-1;i--){
          if(v[i]==b+1){
            b++;
            eraser(v,i);
            break;
          }
        }
      }
      if(v.size()==0){
        std::cout << "yes" << '\n';
        break;
      }
      player1=false;
      for(int i=v2.size()-1;i>-1;i--){
        if(v2[i]==b+1){
          b++;
          eraser(v2,i);
          player2=true;
          break;
        }
      }
      if(!player2){
        for(int i=0;i<v2.size();i++){
          if(v2[i]==a-1){
            a--;
            eraser(v2,i);
            break;
          }
        }
      }
      player2=false;
      if(v2.size()==0){
        std::cout << "no" << '\n';
        break;
      }

  }
}else{
  for(;;){
    for(int i=v.size()-1;i>-1;i--){
      if(v[i]==b+1){
        b++;
        eraser(v,i);
        player1=true;
        break;
      }
    }
    if(!player1){
      for(int i=0;i<v.size();i++){
        if(v[i]==a-1){
          a--;
          eraser(v,i);
          break;
        }
      }
    }
    player1=false;
    if(v.size()==0){
      std::cout << "yes" << '\n';
      break;
    }

    for(int i=0;i<v2.size();i++){
      if(v2[i]==a-1){
        a--;
        eraser(v2,i);
        player2=true;
        break;
      }
    }
    if(!player2){
      for(int i=v2.size()-1;i>-1;i--){
        if(v2[i]==b+1){
          b++;
          eraser(v2,i);
          break;
        }
      }
    }
    if(v2.size()==0){
      std::cout << "no" << '\n';
      break;
    }
    player2=false;
  }

}

}
}




Measured memory_bytes: 3116