#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  int diff = a[1] - a[0];
  bool check = true;
  for (int i = 0; i < N - 1; i++) {
    if ((a[i + 1] - a[i]) != diff) check = false;
    cerr << a[i] << endl;
  }
  if (check == true)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
