#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<cctype>
#include<ctime>
#include<iomanip>
#include<algorithm>
#include<queue>
using namespace std;
const int N=1e5+6;
int n,ch[N][12],tot=0,ed[N],t,tag,v[N];
void insert(char* a)
{
int len=strlen(a),u=0;
for(int m=0;m<len;m++)
{
int c=a[m]-'0';
if(!ch[u][c])
{
ch[u][c]=++tot;
v[u]=1;
}
if(ed[u])
{
tag=0;
return ;
}
u=ch[u][c];
}
if(v[u]) tag=0;
ed[u]=1;
return ;
}
int main()
{
scanf("%d",&t);
for(int i=1;i<=t;i++)
{
tot=1;tag=1;
memset(ch,0,sizeof(ch));
memset(ed,0,sizeof(ed));
memset(v,0,sizeof(v));
scanf("%d",&n);
for(int j=1;j<=n;j++)
{
char a[20];
scanf("%s",a);
if(tag) insert(a);
}
if(tag) cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
return 0;
}