import sys input = sys.stdin.readline from collections import * class RollingHash: def __init__(self, s, base=17, mod=10**9+7): self.base = base self.mod = mod self.acc = [0] self.power = [1] for i in range(len(s)): self.acc.append((self.acc[-1]*self.base%self.mod+ord(s[i])-ord('a')+1)%self.mod) self.power.append(self.power[-1]*self.base%self.mod) def get(self, l, r): return (self.acc[r]-self.acc[l]*self.power[r-l])%self.mod N = int(input()) ws = set() base1, mod1 = 17, 10**9+7 base2, mod2 = 31, 10**9+9 for _ in range(N): S = input()[:-1] n = len(S) rh1 = RollingHash(S, base1, mod1) rh2 = RollingHash(S, base2, mod2) h1 = rh1.get(0, n) h2 = rh2.get(0, n) if (h1, h2) in ws: print('Yes') else: for i in range(n-1): nh1 = h1 nh1 += (ord(S[i+1])-ord(S[i]))*rh1.power[n-1-i]%mod1 nh1 += (ord(S[i])-ord(S[i+1]))*rh1.power[n-2-i]%mod1 nh1 %= rh1.mod nh2 = h2 nh2 += (ord(S[i+1])-ord(S[i]))*rh2.power[n-1-i]%mod2 nh2 += (ord(S[i])-ord(S[i+1]))*rh2.power[n-2-i]%mod2 nh2 %= rh2.mod if (nh1, nh2) in ws: print('Yes') break else: print('No') ws.add((h1, h2))