from functools import cache N = int(input()) P = [input() for i in range(N)] @cache def X(l, r): if l == r: return P[l-1] return P[l-1] == X(l + 1, r) and "Yes" or "No" for r in range(1, N+1): print(X(1, r))