using System; using System.Linq; public class P0406 { public static void Main() { var n = int.Parse(Console.ReadLine().Trim()); var x = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList(); x.Sort(); var result = x.SkipLast(1).Zip(x.Skip(1), (i, j) => j - i).Distinct().ToList(); if(result.Count() == 1 && result[0] > 0) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } }