n = int(input()) ll = [input() for i in range(n)] ans = [True]*n for y in [10**9+7, 998244353]: ss = [] sh = [] b = 50 mod = y for i in range(n): aa = [] s = ll[i] 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) ans[i] &= flg for i in ans: print('Yes') if i else print('No')