N=int(input()) Eto=["ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"] A=[input() for i in range(N)] max_cnt=0 for k in Eto: cnt=A.count(k) max_cnt=max(max_cnt,cnt) print("NO" if max_cnt>(N/2+1) else "YES")