from collections import defaultdict,deque

import sys,heapq,bisect,math,itertools,string,queue,datetime

sys.setrecursionlimit(10**8)

INF = float('inf')

mod = 10**9+7

eps = 10**-7

def inpl(): return list(map(int, input().split()))

def inpls(): return list(input().split())



N = int(eval(input()))

ww = [eval(input()) for i in range(N)]



if len(set(ww)) != N:

	print('No')

else:

	for i in range(N-1):

		a = ww[i]

		b = ww[i+1]

		if a[-1] != b[0]:

			print('No')

			sys.exit()

	print('Yes')

from collections import defaultdict

import sys,heapq,bisect,math,itertools,string,queue,datetime

sys.setrecursionlimit(10**8)

INF = float('inf')

mod = 10**9+7

eps = 10**-7

def inpl(): return list(map(int, input().split()))

def inpl_str(): return list(input().split())



N = int(eval(input()))

li = []

start = True

for i in range(N):

    w = eval(input())

    if w in li:

        print('No')

        exit()



    li.append(w)

    if start:

        start = False

    else:

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

            print('No')

            exit()

    bef = w



print('Yes')    

from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, datetime

sys.setrecursionlimit(10**8)
INF = float("inf")
mod = 10**9 + 7
eps = 10**-7


def inpl():
    return list(map(int, input().split()))


def inpls():
    return list(input().split())


N = int(eval(input()))
ww = [eval(input()) for i in range(N)]
if len(set(ww)) != N:
    print("No")
else:
    for i in range(N - 1):
        a = ww[i]
        b = ww[i + 1]
        if a[-1] != b[0]:
            print("No")
            sys.exit()
    print("Yes")

from collections import defaultdict
import sys, heapq, bisect, math, itertools, string, queue, datetime

sys.setrecursionlimit(10**8)
INF = float("inf")
mod = 10**9 + 7
eps = 10**-7


def inpl():
    return list(map(int, input().split()))


def inpl_str():
    return list(input().split())


N = int(eval(input()))
li = []
start = True
for i in range(N):
    w = eval(input())
    if w in li:
        print("No")
        exit()
    li.append(w)
    if start:
        start = False
    else:
        if bef[-1] != w[0]:
            print("No")
            exit()
    bef = w
print("Yes")

-from collections import defaultdict, deque +from collections import defaultdict -def inpls(): +def inpl_str(): -ww = [eval(input()) for i in range(N)] -if len(set(ww)) != N: -    print("No") -else: -    for i in range(N - 1): -        a = ww[i] -        b = ww[i + 1] -        if a[-1] != b[0]: +li = [] +start = True +for i in range(N): +    w = eval(input()) +    if w in li: +        print("No") +        exit() +    li.append(w) +    if start: +        start = False +    else: +        if bef[-1] != w[0]: -            sys.exit() -    print("Yes") +            exit() +    bef = w +print("Yes")