#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class t, class u>
bool chmax(t &a, u b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class t, class u>
bool chmin(t &a, u b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
ll mod = 1000000007;
signed main() {
  int n;
  cin >> n;
  vector<int> a;
  for (int i = int(0); i < int(n); i++) {
    int b;
    cin >> b;
    a.push_back(b);
  }
  bool f = true;
  for (int i = int(0); i < int(n); i++) {
    if (a[i] != 0) {
      f = false;
      break;
    }
  }
  if (f) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> m;
  for (int i = int(0); i < int(n); i++) {
    m[a[i]]++;
  }
  if (m.size() == 2) {
    if (m[0] == n / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (m.size() == 3) {
    if (m[0] > 0) {
      cout << "No" << endl;
      return 0;
    }
    for (auto &i : m) {
      if (i.second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
