#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  if (a.at(0) == 0 && a.at(n - 1) == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 == 0) {
    if (a.at(0) == a.at(n / 3 - 1) && a.at(n / 3) == a.at(n * 2 / 3 - 1) &&
        a.at(n * 2 / 3) == a.at(n - 1))
      cout << "Yes" << endl;
    else if (a.at(0) == 0 && a.at(0) == a.at(n / 3 - 1) &&
             a.at(n / 3) == a.at(n - 1))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
}
