#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <map>
#include <vector>
#define N 200010
#define ls x << 1
#define rs x << 1 | 1
#define inf 10000000000
#define inc(i) (++ (i))
#define dec(i) (-- (i))
// #define mid ((l + r) >> 1)
//#define int long long
#define XRZ 212370440130137957
#define debug() puts("XRZ TXDY");
#define mem(i, x) memset(i, x, sizeof(i));
#define Next(i, u) for(register int i = head[u]; i ; i = e[i].nxt)
#define file(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout);
#define Rep(i, a, b) for(register int i = (a) , i##Limit = (b) ; i <= i##Limit ; inc(i))
#define Dep(i, a, b) for(register int i = (a) , i##Limit = (b) ; i >= i##Limit ; dec(i))
int dx[10] = {1, -1, 0, 0};
int dy[10] = {0, 0, 1, -1};
using namespace std;
const int base = 30;
const int prime = 19260817;
inline int read() {
register int x = 0, f = 1; register char c = getchar();
while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
while(c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
return x * f;
}
int n, sum[N][26], num, val[N]; char s[N]; bool vis[N], flag;
int id(char s) { return s - '0';}
void add() {
int len = strlen(s), rt = 0;
Rep(i, 1, len) { int now = id(s[i]);
if(val[sum[rt][now]]) { flag = 1; return ;}
if(sum[rt][now] == 0) { mem(sum[num], 0);
vis[num] = 1; sum[rt][now] = num ++;
}
else if(i == len) {flag = 1; return ;} rt = sum[rt][now];
} val[rt] = 1;
}
signed main() { int T = read();
while(T --) { n = read(); flag = 0; mem(sum, 0) mem(val, 0) mem(vis, 0)
Rep(i, 1, n) scanf("%s", s), add();
if(flag) puts("Yes"); else puts("No");
}
return 0;
}