#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
int main() {
  int N;
  cin >> N;
  ll a[N];
  for (int i = 0; i < N; i++) cin >> a[i];
  bool flag = true;
  sort(a, a + N);
  int tolerance = a[1] - a[0];
  for (int i = 2; i < N; i++) {
    if ((a[i] - a[i - 1]) != tolerance) flag = false;
  }
  if (flag)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  return 0;
}
