n = int(input()) rec = [0] * 12 for i in range(n): a = input() if a == "ne": rec[0] += 1 elif a == "ushi": rec[1] += 1 elif a == "tora": rec[2] += 1 elif a == "u": rec[3] += 1 elif a == "tatsu": rec[4] += 1 elif a == "mi": rec[5] += 1 elif a == "uma": rec[6] += 1 elif a == "hitsuji": rec[7] += 1 elif a == "saru": rec[8] += 1 elif a == "tori": rec[9] += 1 elif a == "inu": rec[10] += 1 elif a == "i": rec[11] += 1 if max(rec) > n // 2 + int(n % 2 != 0): print("NO") else: print("YES")