using System; namespace yukicoder { class Program { static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); string[] s = Console.ReadLine().Split(' '); int[] b = new int[a]; int k=0; int count = 0; for(int i = 0; i < a; i++) { b[i] = int.Parse(s[i]); } Array.Sort(b); for(int x = a - 1; x > 0; x--) { if (x == a - 1&& b[x] != b[x - 1]) { k = b[x] - b[x - 1]; count++; } else if (k==b[x] - b[x - 1] && b[x] != b[x - 1]) { count++; } } if (count == a - 1) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } }