#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long mod = 1e9 + 7;
const int inf = 1 << 30;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  bool f = 1;
  for (int i = 0; i < (int)(n); i++) {
    if (a[i] != 0) f = 0;
  }
  if (f) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<long long, int> mp;
  for (int i = 0; i < (int)(n); i++) {
    mp[a[i]]++;
  }
  if (mp.size() == 3) {
    bool f = 1;
    for (auto c : mp) {
      if (c.second != n / 3) f = 0;
    }
    if (f) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (mp.size() == 2) {
    bool f = 0, f1 = 0, f2 = 0;
    for (auto c : mp) {
      if (c.first != 0 && c.second == 2 * n / 3) f1 = 1;
      if (c.first == 0 && c.second == n / 3) f2 = 1;
    }
    if (f1 && f2) f = 1;
    if (f) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
