import sys



n = int(eval(input()))

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



t = len(list(set(word)))



if n != t:

    print("No")

else:

    for i in range(n-1):

        if word[i][-1] == word[i+1][0]:

            continue

        else:

            print("No")

            sys.exit()

    else:

        print("Yes")
n = int(eval(input()))



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



spoken = {words[0]}



for x, y in zip(words, words[1:]):

    if y[0] != x[-1]:

        print("No")

        exit()

    if y in spoken:

        print("No")

        exit()

    spoken.add(y)

else:

    print("Yes")

import sys

n = int(eval(input()))
word = [eval(input()) for _ in range(n)]
t = len(list(set(word)))
if n != t:
    print("No")
else:
    for i in range(n - 1):
        if word[i][-1] == word[i + 1][0]:
            continue
        else:
            print("No")
            sys.exit()
    else:
        print("Yes")

n = int(eval(input()))
words = [eval(input()) for _ in range(n)]
spoken = {words[0]}
for x, y in zip(words, words[1:]):
    if y[0] != x[-1]:
        print("No")
        exit()
    if y in spoken:
        print("No")
        exit()
    spoken.add(y)
else:
    print("Yes")

-import sys - -word = [eval(input()) for _ in range(n)] -t = len(list(set(word))) -if n != t: -    print("No") +words = [eval(input()) for _ in range(n)] +spoken = {words[0]} +for x, y in zip(words, words[1:]): +    if y[0] != x[-1]: +        print("No") +        exit() +    if y in spoken: +        print("No") +        exit() +    spoken.add(y) -    for i in range(n - 1): -        if word[i][-1] == word[i + 1][0]: -            continue -        else: -            print("No") -            sys.exit() -    else: -        print("Yes") +    print("Yes")