import itertools N = input() LIST = [] for i in range(N): LIST.append(raw_input()) BBB = [i for i in itertools.permutations(LIST)] for i in range(len(BBB)): CCC = BBB[i] OK = 1 DDD = CCC[0] for j in range(N-1): if CCC[j+1] == DDD: OK = 0 break DDD = CCC[j+1] if OK == 1: print "YES" break if OK == 0: print "NO"