#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (x == 0) {
    return y;
  } else {
    return gcd(y % x, x);
  }
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    mp[a[i]]++;
  }
  sort(a.begin(), a.end());
  if (a[n - 1] == 0) {
    cout << "Yes\n";
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No\n";
    return 0;
  }
  if (mp.size() > 3) {
    cout << "No\n";
    return 0;
  }
  if (mp.size() == 2) {
    if (mp[0] == n / 3 && mp[a[n / 3]] == n / 3 * 2) {
      cout << "Yes\n";
      return 0;
    }
  } else if (mp.size() == 3) {
    if (mp[a[0]] == n / 3 && mp[a[n / 3]] == n / 3 &&
        mp[a[n / 3 * 2]] == n / 3) {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}
