using System; using System.Collections.Generic; using System.Linq; public class Test { public static void Main() { var N = int.Parse(Console.ReadLine()); var x = Console.ReadLine() .Split(' ') .Select(n => int.Parse(n)) .ToList(); x.Sort(); var d = new List(); for(int i = 0; i < x.Count - 1; i++) d.Add(x[i + 1] - x[i]); string ans = "YES"; for(int j = 0; j < d.Count; j++) { if(d[0] == 0) { ans = "NO"; break; } if(d[j] != d[0] || d[j] == 0) { ans = "NO"; break; } } Console.WriteLine(ans); } }