#include <bits/stdc++.h>
const long long N = 500005;
const long long mod = 1e9 + 7;
using namespace std;
void solve() {
  long long n, m, k, x = 0, y = 0, c = 0, q, ans = 0;
  cin >> n;
  long long a[n];
  std::map<long long, long long> mp;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp.size() == 1 and mp.count(0) > 0) {
    cout << "Yes"
         << "\n";
    return;
  }
  if (mp.size() == 2) {
    auto it = mp.begin();
    auto xt = it;
    xt++;
    if (it->first == 0 and
        (it->second == 2 * (xt->second) or xt->second == 2 * (it->second))) {
      cout << "Yes"
           << "\n";
      return;
    }
  }
  if (mp.size() == 3) {
    auto it = mp.begin();
    x = it->second;
    it++;
    for (it; it != mp.end(); it++) {
      if (it->second == x) c++;
    }
    if (c == 2) {
      cout << "Yes"
           << "\n";
      return;
    }
  }
  cout << "No"
       << "\n";
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
