#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    v[i];
    if (mp.find(v[i]) == mp.end()) {
      mp.emplace(v[i], 1);
    } else {
      mp[v[i]]++;
    }
  }
  if (mp.size() % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (auto itr = mp.begin(); itr != mp.end(); itr++) {
    if (itr->second != mp.begin()->second) {
      cout << "No" << endl;
      return 0;
    }
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  if (v[2] - v[0] == v[1]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
