n = int(input()) eto_name=['ne','ushi','tora','u','tatsu','mi','uma','hitsuji','saru','tori','inu','i'] eto_count_start=[0,0,0,0,0,0,0,0,0,0,0,0] eto_count=dict(zip(eto_name,eto_count_start)) for i in range(n): eto_count[input()]+=1 YorN = True standpoint = int((n+1)/2) for name in eto_name: if eto_count[name]>standpoint: YorN = False if YorN: print("YES") else: print("NO")