import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); String[] etoes = new String[]{"ne", "ushi", "tora", "u", "tatsu", "mi", "uma", "hitsuji", "saru", "tori", "inu", "i"}; HashMap idxes = new HashMap<>(); for (int i = 0; i < etoes.length; i++) { idxes.put(etoes[i], i); } int[] counts = new int[etoes.length]; int n = sc.nextInt(); for (int i = 0; i < n; i++) { counts[idxes.get(sc.next())]++; } Arrays.sort(counts); if (counts[counts.length - 1] > (n + 1) / 2) { System.out.println("NO"); } else { System.out.println("YES"); } } }