Here is my code for the question:

#include<stdio.h>

```
int main(){
int arr[100];
int narr[50];
narr[0]=0;
int t,n,i,j=0,k;
scanf("%d",&t);
for(;t>0;t--) {
int flag=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&arr[i]);
}
for(i=1;i<=7;i++){
while(arr[j]==i){
j++;
}
narr[i]=j;
for(k=i-1;k>0;k--){
narr[i]-=narr[k];
}
}
for(i=6;i>0;i--){
while(arr[j]==i){
j++;
}
narr[14-i]=j;
for(k=13-i;k>0;k--){
narr[14-i]-=narr[k];
}
}
for(i=1;i<14;i++){
if(narr[i]!=0&&(narr[i]==narr[14-i])&& arr[i-1]<8&&arr[i-1]>0){
}
else
{
flag = 1;
break;
}
}
if(flag==0)
printf("yes\n");
else
printf("no\n");
}
}
```

I have tried several inputs and i got the right output.Can anyone point out where this code is wrong?