n=int(eval(input()))

s=[]

for i in range (n):

    s.append('a')

for i in range(n):

    s[i]= [j for j in eval(input())]

flag=True

for i in range(n-1):

    k = len(s[i])

    if s[i][k-1]==s[i+1][0]:

        for j in range(n):

            if s[i]==s[j] and i!=j:

                flag=False

                break

    else:

        flag=False

        break

if flag :

    print("Yes")

else:

    print("No")

import sys

n = int(eval(input()))

w = []

for x in range(n):

    w.append(eval(input()))



sw = sorted(w)

for i in range(1, len(sw)):

    if sw[i - 1] == sw[i]:

        print("No")

        sys.exit()

for i in range(1, len(w)):

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

        print("No")

        sys.exit()

print("Yes")
n = int(eval(input()))
s = []
for i in range(n):
    s.append("a")
for i in range(n):
    s[i] = [j for j in eval(input())]
flag = True
for i in range(n - 1):
    k = len(s[i])
    if s[i][k - 1] == s[i + 1][0]:
        for j in range(n):
            if s[i] == s[j] and i != j:
                flag = False
                break
    else:
        flag = False
        break
if flag:
    print("Yes")
else:
    print("No")

import sys

n = int(eval(input()))
w = []
for x in range(n):
    w.append(eval(input()))
sw = sorted(w)
for i in range(1, len(sw)):
    if sw[i - 1] == sw[i]:
        print("No")
        sys.exit()
for i in range(1, len(w)):
    if w[i - 1][-1] != w[i][0]:
        print("No")
        sys.exit()
print("Yes")

+import sys + -s = [] -for i in range(n): -    s.append("a") -for i in range(n): -    s[i] = [j for j in eval(input())] -flag = True -for i in range(n - 1): -    k = len(s[i]) -    if s[i][k - 1] == s[i + 1][0]: -        for j in range(n): -            if s[i] == s[j] and i != j: -                flag = False -                break -    else: -        flag = False -        break -if flag: -    print("Yes") -else: -    print("No") +w = [] +for x in range(n): +    w.append(eval(input())) +sw = sorted(w) +for i in range(1, len(sw)): +    if sw[i - 1] == sw[i]: +        print("No") +        sys.exit() +for i in range(1, len(w)): +    if w[i - 1][-1] != w[i][0]: +        print("No") +        sys.exit() +print("Yes")