var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
var n=arr.shift()-0;
arr.forEach(v=>{
   var sente=v.split(" ").map(Number);
   var gote=[];
   for(var i=1;i<=13;i++)gote.push(i);
   gote=gote.filter(x=> !(x==7 || sente.includes(x)));
   var cnt=[0,0];
   
   var saiki=function(a,b,min,max,sg){
      if(a.length==0 && b.length==1)cnt[0]++;
      if(a.length==1 && b.length==0)cnt[1]++;
      if(a.length==0 && b.length==0)return;
      if(sg==0){
         if(a.includes(min))saiki(a.filter(v=> v!=min),b.slice(),min-1,max,1);
         if(a.includes(max))saiki(a.filter(v=> v!=max),b.slice(),min,max+1,1);
         if(!a.includes(min) && !a.includes(max))saiki(a.slice(),b.slice(),min,max,1);
      }else if(sg==1){
         if(b.includes(min))saiki(a.slice(),b.filter(v=> v!=min),min-1,max,0);
         if(b.includes(max))saiki(a.slice(),b.filter(v=> v!=max),min,max+1,0);
         if(!b.includes(min) && !b.includes(max))saiki(a.slice(),b.slice(),min,max,0);
      }
   };

   saiki(sente,gote,6,8,0);
   if(cnt[0]>cnt[1])console.log("yes");
   else console.log("no");
});
