#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> c;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (mp[a] == 0) {
      c.push_back(a);
    }
    mp[a]++;
  }
  sort(c.begin(), c.end());
  if (c.size() == 1) {
    if (c[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (c.size() == 2) {
    if (c[0] == 0 && mp[c[0]] * 2 == mp[c[1]]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (c.size() == 3) {
    if (mp[c[0]] == mp[c[1]] && mp[c[1]] == mp[c[2]]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
