import java.util.*; class A { static Scanner s = new Scanner(System.in); static enum ETO{ ne, ushi, tora, u, tatsu, mi, uma, hitsuji, saru, tori, inu, i, ; int amount=0; static ETO match(String s) { boolean b = false; for(ETO eto:ETO.values()) { if(s.matches(eto.name())) { eto.amount++; return eto; } } return null; } @Override public String toString() { return this.name()+":"+this.amount; } } public static void main(String[] args) { int in = s.nextInt(); while(s.hasNext()) { ETO.match(s.next()); } int max = 0; for(ETO e:ETO.values()) { max = Math.max(max, e.amount); } if(max>in/2+1) { System.out.println("NO"); }else { System.out.println("YES"); } } }