#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  while (cin >> N) {
    map<int, int> m;
    for (int i = 0; i < N; i++) {
      int a;
      cin >> a;
      m[a]++;
    }
    if (m.size() == 1) {
      int a = m.begin()->first;
      if (a == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (m.size() == 2) {
      pair<int, int> a = *m.begin();
      pair<int, int> b = *(++m.begin());
      if (a.first != 0) swap(a, b);
      if (a.first == 0 && a.second * 2 == b.second) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (m.size() == 3) {
      vector<pair<int, int> > v;
      for (auto p : m) {
        v.push_back(p);
      }
      if (v[0].first == 0 || v[1].first == 0 || v[2].first == 0) {
        cout << "No" << endl;
      } else if (v[0].second == v[1].second && v[1].second == v[2].second) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
}
