#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<uint64_t, uint64_t> count;
  for (int i = 0; i < n; i++) {
    uint64_t a;
    cin >> a;
    count[a]++;
  }
  auto check3 = [](const int n, map<uint64_t, uint64_t>& count) {
    if (n % 3 != 0 || count.size() != 3) {
      return false;
    }
    for (auto& elem : count) {
      if (elem.second != n / 3) {
        return false;
      }
    }
    return true;
  };
  auto check2 = [](const int n, map<uint64_t, uint64_t>& count) {
    if (n % 2 != 0 || count.size() != 2) {
      return false;
    }
    bool is_zero = false;
    for (auto& elem : count) {
      if (elem.first == 0) {
        is_zero = true;
      }
      if (elem.second != n / 2) {
        return false;
      }
    }
    return is_zero;
  };
  auto check1 = [](const int n, map<uint64_t, uint64_t>& count) {
    return count[0] == n;
  };
  cout << ((check3(n, count) || check2(n, count) || check1(n, count)) ? "Yes"
                                                                      : "No")
       << endl;
}
