#include <bits/stdc++.h>
using namespace std;
const auto MOD = 1000000007;
const int INF = 1e9;
const long long LINF = 1e18;
int n, m;
string s;
int main() {
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  if (!a[0] && !a[n - 1]) {
    cout << "Yes" << endl;
    return 0;
  }
  if ((n % 3)) {
    cout << "No" << endl;
    return 0;
  }
  int b, c, d;
  b = a[0];
  c = a[n / 3];
  d = a[2 * n / 3];
  for (int i = 0; i < n / 3; i++) {
    if (a[i] != b) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = 0; i < n / 3; i++) {
    if (a[i + n / 3] != c) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = 0; i < n / 3; i++) {
    if (a[i + 2 * n / 3] != d) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
