#include <bits/stdc++.h>
using namespace std;
long long n, a;
map<long long, long long> m;
signed main() {
  cin >> n;
  for (long long i = 0; i < (long long)(n); ++i) cin >> a, m[a]++;
  if (n % 3 == 0) {
    if (m.size() == 2) {
      auto itr = m.begin();
      if (itr->second * 2 == (++itr)->second)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (m.size() == 3) {
      auto itr = m.begin();
      long long a, b, c;
      a = itr->second;
      ++itr;
      b = itr->second;
      ++itr;
      c = itr->second;
      if (a == b && b == c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else
      cout << "No" << endl;
  } else if (m.size() == 1) {
    if (m[0])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
}
