#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
int main() {
  int N;
  map<int, int> cnt;
  int kind = 0;
  cin >> N;
  for (int i = (0); i < (N); i++) {
    int a;
    cin >> a;
    if (cnt.count(a)) {
      cnt[a]++;
    } else {
      cnt[a] = 1;
      kind++;
    }
  }
  bool flag = false;
  if (kind == 1 && cnt.count(0) != 0) flag = true;
  if (kind == 2 && cnt.count(0) != 0 && cnt[0] == N / 3)
    flag = true;
  else if (kind == 3) {
    for (auto itr = cnt.begin(); itr != cnt.end(); itr++) {
      if (itr->second == N / 3)
        flag = true;
      else {
        flag = false;
        break;
      }
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
