#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll N;
int main() {
  cin >> N;
  map<ll, ll> mp;
  for (int i = 0; i < N; i++) {
    ll a;
    cin >> a;
    mp[a]++;
  }
  bool flag = false;
  if (mp.size() == 1) {
    if (mp[0] == N)
      flag = true;
    else
      flag = false;
  } else {
    if (N % 3 == 0) {
      if (mp.size() == 3) {
        flag = true;
        for (auto itr = mp.begin(); itr != mp.end(); itr++) {
          if (itr->second != N / 3) flag = false;
        }
      } else if (mp.size() == 2) {
        vector<ll> tmp(2);
        int cnt = 0;
        for (auto itr = mp.begin(); itr != mp.end(); itr++) {
          tmp[cnt++] = itr->second;
        }
        sort(tmp.begin(), tmp.end());
        if (tmp[1] == ((N / 3) * 2) && tmp[0] == (N / 3)) flag = true;
      }
    }
  }
  cout << ((flag) ? "Yes" : "No") << endl;
}
