def main():

    N = int(eval(input()))

    words = []

    success = True

    for _ in range(N):

        word = eval(input())

        if word in words:

            success = False

        if not words == []:

            if not words[-1][-1] == word[0]:

                success = False

        words.append(word)

    if success:

        print("Yes")

    else:

        print("No")





if __name__ == '__main__':

    main()
def main():

    has_said = set()

    n = int(eval(input()))

    last = ""

    for i in range(n):

        w = eval(input())

        if i > 0 and (w[0] != last or w in has_said):

            print("No")

            break

        last = w[-1]

        has_said.add(w)

    else:

        print("Yes")





if __name__ == '__main__':

    main()



def main():
    N = int(eval(input()))
    words = []
    success = True
    for _ in range(N):
        word = eval(input())
        if word in words:
            success = False
        if not words == []:
            if not words[-1][-1] == word[0]:
                success = False
        words.append(word)
    if success:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

def main():
    has_said = set()
    n = int(eval(input()))
    last = ""
    for i in range(n):
        w = eval(input())
        if i > 0 and (w[0] != last or w in has_said):
            print("No")
            break
        last = w[-1]
        has_said.add(w)
    else:
        print("Yes")


if __name__ == "__main__":
    main()

-    N = int(eval(input())) -    words = [] -    success = True -    for _ in range(N): -        word = eval(input()) -        if word in words: -            success = False -        if not words == []: -            if not words[-1][-1] == word[0]: -                success = False -        words.append(word) -    if success: +    has_said = set() +    n = int(eval(input())) +    last = "" +    for i in range(n): +        w = eval(input()) +        if i > 0 and (w[0] != last or w in has_said): +            print("No") +            break +        last = w[-1] +        has_said.add(w) +    else: -    else: -        print("No")