eto = {"ne":0,"ushi":0,"tora":0,"u":0,"tatsu":0,"mi":0,"uma":0,"hitsuji":0,"saru":0,"tori":0,"inu":0,"i":0} N = int(raw_input()) for i in range(N): eto[raw_input()] += 1 s = 0 m = 0 for i in eto.keys(): s += eto[i] m = max(m,eto[i]) if s % 2 == 0: if s / 2 >= m: print 'YES' else: print 'NO' else: if s / 2 + 1 >= m: print 'YES' else: print 'NO'