#include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
const long long MOD = 1000000007;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a;
  a.resize(n);
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
  }
  map<int, int> cnt;
  for (int i = (0); i < (n); ++i) {
    if (cnt.find(a[i]) != cnt.end()) {
      cnt[a[i]]++;
    } else {
      cnt[a[i]] = 1;
    }
  }
  if (n % 3) {
    if (cnt.size() > 1) {
      cout << "No" << endl;
    } else if (cnt.find(0) != cnt.end()) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    for (auto it = cnt.begin(); it != cnt.end(); ++it) {
      if (it->second != (n / 3)) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  }
  return 0;
}
