import java.util.Arrays; import java.util.Scanner; public class No406 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int count = s.nextInt(); int[] arr = new int[count]; for (int i = 0; i < count; i++) { arr[i] = s.nextInt(); } Arrays.sort(arr); String out = "YES"; int diff = arr[1] - arr[0]; if (diff == 0) { out = "NO"; } else { for (int i = 2; i < count; i++) { if (arr[i] - arr[i - 1] != diff) { out = "NO"; break; } } } System.out.println(out); } }