#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < (int)(N); i++) {
    cin >> A[i];
  }
  map<int, long long> G;
  for (int i = 0; i < (int)(N); i++) {
    G[A[i]]++;
  }
  bool ok = true;
  switch (G.size()) {
    case 1:
      for (auto x : G) {
        if (x.first != 0) {
          ok = false;
        }
      }
      break;
    case 2:
      for (auto x : G) {
        if (x.first == 0) {
          if (x.second != (N / 3)) {
            ok = false;
            break;
          }
        } else {
          if (x.second != (2 * N / 3)) {
            ok = false;
            break;
          }
        }
      }
      break;
    case 3:
      for (auto x : G) {
        if (x.second != (N / 3)) {
          ok = false;
          break;
        }
      }
      break;
    default:
      ok = false;
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
