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