#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout << fixed << setprecision(15);
  ;
  long long n;
  cin >> n;
  map<long long, long long> cnt;
  for (long long i = 0, i_len = (long long)(n); i < i_len; i++) {
    long long a;
    cin >> a;
    cnt[a]++;
  }
  if (cnt[0] == n)
    cout << "Yes"
         << "\n";
  else if (n % 3 != 0 || cnt.size() >= 4)
    cout << "No"
         << "\n";
  else {
    if (cnt.size() == 3) {
      long long num = n / 3;
      bool ans = true;
      for (auto &p : cnt) {
        if (p.second != num) ans = false;
      }
      ans ? cout << "Yes"
                 << "\n"
          : cout << "No"
                 << "\n";
    } else {
      long long num = n / 3;
      bool ans = true;
      for (auto &p : cnt) {
        if ((p.first == 0 && p.second != num) ||
            (p.first != 0 && p.second != num * 2))
          ans = false;
      }
      ans ? cout << "Yes"
                 << "\n"
          : cout << "No"
                 << "\n";
    }
  }
}
