import java.util.HashMap; import java.util.Scanner; import java.util.Map.Entry; public class Main2 { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { int N = scan.nextInt(); HashMap map = new HashMap<>(); for(int i=0; i e : map.entrySet()) { max = Math.max(max, e.getValue()); } if((N+1)/2 >= max) { System.out.println("YES"); } else { System.out.println("NO"); } } } }