#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
template <class T>
T max(T *a, long long n) {
  T maxi = a[0];
  for (long long i = 0; i < n; ++i) {
    if (a[i] > maxi) maxi = a[i];
  }
  return maxi;
}
template <class T>
T max_index(T *a, long long n) {
  T maxi = a[0];
  T index = 0;
  for (long long i = 0; i < n; ++i) {
    if (a[i] > maxi) {
      maxi = a[i];
      index = i;
    }
  }
  return index;
}
template <class T>
T min(T *a, long long n) {
  T mini = a[0];
  for (long long i = 0; i < n; ++i) {
    if (a[i] < mini) mini = a[i];
  }
  return mini;
}
template <class T>
T min_index(T *a, long long n) {
  T mini = a[0];
  T index = 0;
  for (long long i = 0; i < n; ++i) {
    if (a[i] < mini) {
      mini = a[i];
      index = i;
    }
  }
  return index;
}
template <class T>
T sum(T *a, long long n) {
  T s = 0;
  for (long long i = 0; i < n; ++i) {
    s += a[i];
  }
  return s;
}
int main() {
  long long n;
  cin >> n;
  long long f[n];
  for (int i = (0); i < (n); ++i) {
    cin >> f[i];
  }
  map<long long, long long> p;
  vector<long long> c;
  for (int i = (0); i < (n); ++i) {
    if (p[f[i]] == 0) {
      c.push_back(f[i]);
    }
    p[f[i]] += 1;
  }
  if (p[0] == n) {
    cout << "Yes";
    return 0;
  }
  if (c.size() != 3) {
    cout << "No";
    return 0;
  }
  long long x = c[0];
  long long y = c[1];
  long long z = c[2];
  if (p[x] == p[y] && p[y] == p[z]) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
