#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, a;
  bool ans = false;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a;
    mp[a]++;
  }
  vector<int> c;
  for (auto s : mp) {
    c.push_back(s.first);
    c.push_back(s.second);
  }
  if (c[0] == 0 && c[1] == n) ans = true;
  if (n % 3 == 0 && c[0] == 0 && c[1] * 3 == n) ans = true;
  if (n % 3 == 0 && c[1] == c[3] == c[5] == n / 3) ans = true;
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
