#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  cin >> n;
  string ans = "Yes";
  vector<int> a(n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) cnt++;
  }
  if (cnt == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n >= 4) {
    cout << "No" << endl;
    return 0;
  }
  sort(a.begin(), a.end());
  if (a[0] == 0 && a[1] == a[2]) {
    cout << "Yes" << endl;
    return 0;
  }
  if (a[0] < a[1] && a[1] < a[2] && a[2] - a[1] == a[0] &&
      a[1] % ((a[2] - a[1]) * 2) == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
