import java.util.*; import java.math.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { int n = sc.nextInt(); int[] ary = new int[12]; for (int i = 0;i < n;i++) { String s = sc.next(); if (s.equals("ne")) ary[0]++; if (s.equals("ushi")) ary[1]++; if (s.equals("tora")) ary[2]++; if (s.equals("u")) ary[3]++; if (s.equals("tatsu")) ary[4]++; if (s.equals("mi")) ary[5]++; if (s.equals("uma")) ary[6]++; if (s.equals("hitsuji")) ary[7]++; if (s.equals("saru")) ary[8]++; if (s.equals("tori")) ary[9]++; if (s.equals("inu")) ary[10]++; if (s.equals("i")) ary[11]++; } int max = 0; for (int i = 0;i < 12;i++) { max = Math.max(max,ary[i]); } if (n%2==0) { if (max>n/2) { System.out.println("NO"); } else { System.out.println("YES"); } } else { if (max>(n+1)/2) { System.out.println("NO"); } else { System.out.println("YES"); } } } }