l=open(0).readlines()[1:];print(('YNeos'[any(a[-2]!=b[0]*l.count(a)for a,b in zip(l,l[1:]))::2]))
_,*l=open(0).readlines();print(('YNeos'[any(a[-2]!=b[0]*l.count(a)for a,b in zip(l,l[1:]))::2]))
l = open(0).readlines()[1:]
print(("YNeos"[any(a[-2] != b[0] * l.count(a) for a, b in zip(l, l[1:])) :: 2]))

_, *l = open(0).readlines()
print(("YNeos"[any(a[-2] != b[0] * l.count(a) for a, b in zip(l, l[1:])) :: 2]))

-l = open(0).readlines()[1:] +_, *l = open(0).readlines()