#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll mod = 1000000007;
ll power(ll base, ll exponent) {
  if (exponent % 2) {
    return power(base, exponent - 1) * base % mod;
  } else if (exponent) {
    ll root_ans = power(base, exponent / 2);
    return root_ans * root_ans % mod;
  } else {
    return 1;
  }
}
ll inverse(ll x) { return power(x, mod - 2); }
ll gcd(ll a, ll b) {
  if (a < b) gcd(b, a);
  ll r;
  while (r = a % b) {
    a = b;
    b = r;
  }
  return b;
}
struct combination {
  vector<ll> fact, inv;
  combination(int sz) : fact(sz + 1), inv(sz + 1) {
    fact[0] = 1;
    for (int i = 1; i <= sz; i++) {
      fact[i] = fact[i - 1] * i % mod;
    }
    inv[sz] = power(fact[sz], mod - 2);
    for (int i = sz - 1; i >= 0; i--) {
      inv[i] = inv[i + 1] * (i + 1) % mod;
    }
  }
  ll C(int p, int q) const {
    if (q < 0 || p < q) return 0;
    return (fact[p] * inv[q] % mod * inv[p - q] % mod);
  }
};
int bsearch(const vector<ll>& a, ll x) {
  int lft = 0;
  int rgt = a.size();
  while (rgt - lft > 1) {
    int mid = (lft + rgt) / 2;
    if (a[mid] < x) {
      lft = mid;
    } else {
      rgt = mid;
    }
  }
  return lft;
}
signed main() {
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  map<ll, ll> a;
  for (ll i = 0; i < (n); ++i) {
    ll b;
    cin >> b;
    if (a.count(b)) {
      a[b]++;
    } else {
      a[b] = 1;
    }
  }
  if (a.size() == 1) {
    if (a.count(0)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  if (a.size() == 2) {
    for (const auto i : a) {
      if (i.first == 0 && a[i.first] == n / 3) {
      } else if (a[i.first] == 2 * n / 3) {
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  if (a.size() == 3) {
    for (const auto i : a) {
      if (a[i.first] == n / 3) {
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
