#include <bits/stdc++.h>
using namespace std;
int N;
map<int, int> M;
void f() {
  cout << "Yes\n";
  exit(0);
}
void g() {
  cout << "No\n";
  exit(0);
}
int main(void) {
  cin >> N;
  for (int x, i = 0; i < N; i++) cin >> x, M[x]++;
  if (M.size() == 1) {
    if (M.count(0))
      f();
    else
      g();
  } else if (M.size() == 2) {
    if (M.count(0) && M[0] * 3 == N)
      f();
    else
      g();
  } else if (M.size() == 3) {
    auto it = M.begin();
    int x = it->first;
    it++;
    int y = it->first;
    it++;
    int z = it->first;
    if (x != 0 && M[x] * 3 == N && M[y] * 3 == N && M[z] * 3 == N)
      f();
    else
      g();
  } else
    g();
}
