#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < (int)(n); i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp.find(0) != mp.end()) {
    if (mp.size() == 1) {
      cout << "Yes" << endl;
    } else if (mp.size() == 2 && n % mp[0] == 0 && n / mp[0] == 3) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else {
    if (mp.size() == 3) {
      for (auto m : mp) {
        if (n % m.second != 0 || n / m.second != 3) {
          cout << "No" << endl;
          return 0;
        }
      }
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  return 0;
}
