#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& i : a) cin >> i;
  sort(a.begin(), a.end());
  if (n % 3 == 0) {
    if (a[0] == a[n / 3 - 1] && a[n / 3] == a[(n / 3) * 2 - 1] &&
        a[(n / 3) * 2] == a[n - 1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  if (n % 3 == 1) {
    if (a[0] == a[n / 3 - 1] && a[0] == 0 && a[n / 3] == a[n - 1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  if (n % 3 == 2) {
    if (a[0] == a[n / 3] && a[0] == 0 && a[n / 3 + 1] == a[n - 1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
