package yukicoder; import java.util.Scanner; public class No349 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.nextLine(); String[] s = new String[N]; int[] eto = new int[12]; for (int i = 0; i < s.length; i++) { s[i] = sc.nextLine(); switch (s[i]) { case "ne": eto[0]++; break; case "ushi": eto[1]++; break; case "tora": eto[2]++; break; case "u": eto[3]++; break; case "tatsu": eto[4]++; break; case "mi": eto[5]++; break; case "uma": eto[6]++; break; case "hitsuji": eto[7]++; break; case "saru": eto[8]++; break; case "tori": eto[9]++; break; case "inu": eto[10]++; break; case "i": eto[11]++; break; } } boolean b = false; for (int i = 0; i < 12; i++) { int t = N; t -= eto[i]; if (!(eto[i] - 1 <= t)) { b = true; } } if (b) { System.out.println("NO"); } else { System.out.println("YES"); } } }