#include <bits/stdc++.h>
const int mod = 1e9 + 7;
using LL = long long;
using namespace std;
namespace ndifix {
template <class T>
void sort(T &v) {
  std::sort(v.begin(), v.end());
}
template <class T>
void rsort(T &v) {
  std::sort(v.rbegin(), v.rend());
}
}  // namespace ndifix
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  set<int> s;
  for (int i = 0; i < n; i++) s.insert(a[i]);
  ndifix::sort(a);
  if (s.size() == 1) {
    if (a[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    if (a[0] != 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (s.size() == 2) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    int p, q, r;
    if (a[0] == a[2 * n / 3 - 1]) {
      cout << "No" << endl;
      return 0;
    }
    a.erase(a.begin(), a.begin() + 2 * n / 3);
    if (a[n / 3] == a[n - 1]) {
      cout << "No" << endl;
      return 0;
    }
    a.erase(a.begin() + n / 3, a.end());
    if (a[0] != a.back()) {
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
    return 0;
  }
  if (s.size() == 3) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (a[0] != a[n / 3 - 1]) {
      cout << "No" << endl;
      return 0;
    }
    a.erase(a.begin(), a.begin() + n / 3);
    if (a[0] != a[n / 3 - 1]) {
      cout << "No" << endl;
      return 0;
    }
    a.erase(a.begin(), a.begin() + n / 3);
    if (a[0] != a[n / 3 - 1]) {
      cout << "No" << endl;
      return 0;
    }
    a.erase(a.begin(), a.begin() + n / 3);
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
