#include <bits/stdc++.h>
using namespace std;
constexpr long long INF = 1e18;
constexpr double PI = 3.14159265358979;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  string ans = "Yes";
  cin >> n;
  vector<long long> a(n), kind;
  map<long long, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (mp[a[i]] == 0) kind.push_back(a[i]);
    mp[a[i]]++;
  }
  if (kind.size() > 3) ans = "No";
  sort(kind.begin(), kind.end());
  if (kind.size() == 1) {
    if (kind[0] != 0) ans = "No";
  } else {
    if (n % 3 != 0) ans = "No";
    if (kind.size() == 2) {
      if (max(mp[kind[0]], mp[kind[1]]) != 2 * min(mp[kind[0]], mp[kind[1]])) {
        ans = "No";
      }
    } else {
      if (!(mp[kind[0]] == mp[kind[1]] and mp[kind[1]] == mp[kind[2]])) {
        ans = "No";
      }
    }
  }
  cout << ans << endl;
  return 0;
}
