N = int(input()) a = [] b = ["ne","ushi","tora","u", "tatsu","mi","uma","hitsuji", "saru","tori","inu","i"] error = 0 for i in range(N): a.append(input()) for i in range(12): if N%2 == 1: if a.count(b[i]) > N/2+1: error = 1 elif a.count(b[i]) > N/2: error = 1 if error == 1: print("NO") else: print("YES")