#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template <typename T>
using Edges = vector<edge<T>>;
template <typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template <typename T>
using Matrix = vector<vector<T>>;
const long long inf = 1LL << 60;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  bool allzero = true;
  for (int i = 0; i < (int)(n); i++)
    if (a[i] != 0) allzero = false;
  if (allzero) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  set<long long> st;
  for (int i = 0; i < (int)(n); i++) st.insert(a[i]);
  if (*st.begin() == 0) {
    if (st.count(0) == n / 3 && st.count(*st.rbegin()) == 2 * n / 3) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
    return 0;
  }
  for (auto v : st) {
    if (st.count(v) != n / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
