x=int(eval(input()))

words=[]

found=0

word_1=''

word_2=''

for i in range(x):

    words.append(eval(input()))



for j in range(x-1):

    for k in range(j+1,x):

        if words[j]==words[k]:

            found=-1

for c in range(x-1):

    word_1=words[c]

    word_2=words[c+1]

    if word_1[-1]!=word_2[0]:

        found=-1

if found==-1:

    print("No")

else:

    print("Yes")
def taka():

    n = int(eval(input()))

    listofwords =[]

    for i in range(n):

        strTEMP = eval(input())



        if i == 0:

            listofwords.append(strTEMP)

            continue

        else:

            if strTEMP in listofwords:

                return "No"

            else:

                cmp = listofwords[-1]

                if strTEMP[0] != cmp[-1]:

                    return "No"

                else:

                    listofwords.append(strTEMP)

    return "Yes"



print((taka()))

x = int(eval(input()))
words = []
found = 0
word_1 = ""
word_2 = ""
for i in range(x):
    words.append(eval(input()))
for j in range(x - 1):
    for k in range(j + 1, x):
        if words[j] == words[k]:
            found = -1
for c in range(x - 1):
    word_1 = words[c]
    word_2 = words[c + 1]
    if word_1[-1] != word_2[0]:
        found = -1
if found == -1:
    print("No")
else:
    print("Yes")

def taka():
    n = int(eval(input()))
    listofwords = []
    for i in range(n):
        strTEMP = eval(input())
        if i == 0:
            listofwords.append(strTEMP)
            continue
        else:
            if strTEMP in listofwords:
                return "No"
            else:
                cmp = listofwords[-1]
                if strTEMP[0] != cmp[-1]:
                    return "No"
                else:
                    listofwords.append(strTEMP)
    return "Yes"


print((taka()))

-x = int(eval(input())) -words = [] -found = 0 -word_1 = "" -word_2 = "" -for i in range(x): -    words.append(eval(input())) -for j in range(x - 1): -    for k in range(j + 1, x): -        if words[j] == words[k]: -            found = -1 -for c in range(x - 1): -    word_1 = words[c] -    word_2 = words[c + 1] -    if word_1[-1] != word_2[0]: -        found = -1 -if found == -1: -    print("No") -else: -    print("Yes") +def taka(): +    n = int(eval(input())) +    listofwords = [] +    for i in range(n): +        strTEMP = eval(input()) +        if i == 0: +            listofwords.append(strTEMP) +            continue +        else: +            if strTEMP in listofwords: +                return "No" +            else: +                cmp = listofwords[-1] +                if strTEMP[0] != cmp[-1]: +                    return "No" +                else: +                    listofwords.append(strTEMP) +    return "Yes" + + +print((taka()))