#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> make_pair;
  vector<int> a(n, 0);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    make_pair[a[i]]++;
  }
  if (make_pair.size() > 3) {
    cout << "No"
         << "\n";
    return 0;
  }
  if (n % 3 == 0) {
    for (auto x : make_pair) {
      if (x.second > n / 3) {
        {
          if (x.second != (2 * n / 3))
            cout << "No"
                 << "\n";
          return 0;
        }
      } else if (x.second < n / 3) {
        cout << "No"
             << "\n";
        return 0;
      }
      if (x.first == 0) {
        if (!x.second == (n / 3))
          cout << "No"
               << "\n";
      }
    }
  }
  cout << "Yes"
       << "\n";
}
