n=int(eval(input()))

w=[eval(input()) for _ in range(n)]

if len(set(w))==n:

    ans=0

else:

    ans=1

for i in range(n-1):

    if w[i][-1]!=w[i+1][0]:

        ans=1

print(("No" if ans else "Yes"))
n=int(eval(input()))

w=[eval(input()) for _ in range(n)]

print(("Yes" if len(set(w))==n and all(i[-1]==j[0] for i,j in zip(w,w[1:])) else "No"))
n = int(eval(input()))
w = [eval(input()) for _ in range(n)]
if len(set(w)) == n:
    ans = 0
else:
    ans = 1
for i in range(n - 1):
    if w[i][-1] != w[i + 1][0]:
        ans = 1
print(("No" if ans else "Yes"))

n = int(eval(input()))
w = [eval(input()) for _ in range(n)]
print(
    (
        "Yes"
        if len(set(w)) == n and all(i[-1] == j[0] for i, j in zip(w, w[1:]))
        else "No"
    )
)

-if len(set(w)) == n: -    ans = 0 -else: -    ans = 1 -for i in range(n - 1): -    if w[i][-1] != w[i + 1][0]: -        ans = 1 -print(("No" if ans else "Yes")) +print( +    ( +        "Yes" +        if len(set(w)) == n and all(i[-1] == j[0] for i, j in zip(w, w[1:])) +        else "No" +    ) +)