import java.util.Scanner; import java.util.Arrays; class S25_duck{ public static void main(String[] args){ int n; String ans = "YES"; Scanner sc = new Scanner(System.in); n = sc.nextInt(); int[] duck = new int[n]; for(int i = 0; i < n; i++){ duck[i] = sc.nextInt(); } Arrays.sort(duck); int a = duck[1] - duck[0]; for(int i = 2; i < n; i++){ if((duck[i] - duck[i-1]) != a || duck[i] == duck[i-1]){ ans = "NO"; break; } } System.out.println(ans); } }