n = int(eval(input()))

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

flag = 1

for i in range(n):

  for j in range(n):

    if i == j:

      continue

    if w[i] == w[j]:

      flag = flag *0

      break

for i in range(n):

  if i == 0:

    continue

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

    flag = flag * 1

  else:

    flag = flag * 0

    

if flag == 1:

  print("Yes")

else:

  print("No")

N = int(eval(input()))

words = []

for i in range(N) :

    words.append(eval(input()))



win = False

for j in range(1, N) :

    if words[j].startswith(words[j-1][-1]) and words[j] not in words[:j]:

       win = True

    else :

        win = False

        break



if win == True :

    print("Yes")

else :

    print("No")

n = int(eval(input()))
w = [eval(input()) for i in range(n)]
flag = 1
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        if w[i] == w[j]:
            flag = flag * 0
            break
for i in range(n):
    if i == 0:
        continue
    if w[i - 1][-1] == w[i][0]:
        flag = flag * 1
    else:
        flag = flag * 0
if flag == 1:
    print("Yes")
else:
    print("No")

N = int(eval(input()))
words = []
for i in range(N):
    words.append(eval(input()))
win = False
for j in range(1, N):
    if words[j].startswith(words[j - 1][-1]) and words[j] not in words[:j]:
        win = True
    else:
        win = False
        break
if win == True:
    print("Yes")
else:
    print("No")

-n = int(eval(input())) -w = [eval(input()) for i in range(n)] -flag = 1 -for i in range(n): -    for j in range(n): -        if i == j: -            continue -        if w[i] == w[j]: -            flag = flag * 0 -            break -for i in range(n): -    if i == 0: -        continue -    if w[i - 1][-1] == w[i][0]: -        flag = flag * 1 +N = int(eval(input())) +words = [] +for i in range(N): +    words.append(eval(input())) +win = False +for j in range(1, N): +    if words[j].startswith(words[j - 1][-1]) and words[j] not in words[:j]: +        win = True -        flag = flag * 0 -if flag == 1: +        win = False +        break +if win == True: