n = int(input()) ss = [] sh = [] b = 50 mod = 10**9+7 for i in range(n): aa = [] s = input() tmp = 0 for i,c in enumerate(s): x = ord(c) - 97 aa.append(x) tmp += x*pow(b, i,mod) tmp %= mod sh.append(tmp) ss.append(aa) v = set() for i in range(n): flg = False if i == 0: v.add(sh[0]) else: x = sh[i] for j in range(len(ss[i])): if j == 0: continue num2 = ss[i][j] num1 = ss[i][j-1] tmp = x - num1*pow(b, j-1 , mod)%mod - num2*pow(b, j, mod)%mod + num1*pow(b, j, mod)%mod + num2*pow(b, j-1, mod)%mod tmp %= mod if tmp in v: flg = True v.add(x) print('Yes') if flg else print('No')