#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const long long MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;
map<int, int> cnt;
vector<pair<int, int> > vv;
void solve() {
  int n, a;
  scanf("%d", &n);
  for (int i = (0); i < (int)(n); i++) {
    scanf("%d", &a);
    cnt[a]++;
  }
  for (__typeof((cnt).begin()) it = (cnt).begin(); it != (cnt).end(); it++) {
    vv.push_back(make_pair(it->first, it->second));
  }
  if ((int)(cnt).size() == 1 && cnt.find(0) != cnt.end()) {
    printf("Yes\n");
    return;
  } else if ((int)(cnt).size() == 2 && cnt.find(0) != cnt.end()) {
    if (vv[0].second * 2 == vv[1].second) {
      printf("Yes\n");
      return;
    }
  } else if ((int)(cnt).size() == 3) {
    if (vv[0].second == vv[1].second && vv[1].second == vv[2].second) {
      printf("Yes\n");
      return;
    }
  }
  printf("No\n");
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
