using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ int max=0; foreach(var k in D.Keys){ max=Math.Max(max,D[k]); } int rest=N-max; Console.WriteLine(max-1>rest?"NO":"YES"); } int N; Dictionary D; public Sol(){ N=ri(); D=new Dictionary(); for(int i=0;iint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }