import sys sys.setrecursionlimit(10**7) from functools import lru_cache @lru_cache(maxsize=None) def calc(i,x): #print(i,x) if i==0: return S[x] elif i==1: return x else: if S[i-2]==x: return calc(i-1,"Yes") else: return calc(i-1,"No") N=int(input()) S=[input().strip() for i in range(N)] print(S[0]) for i in range(1,N): if S[i]==S[i-1]: print(calc(i,"Yes")) else: print(calc(i,"No"))