#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  map<long long, long long> a;
  vector<long long> v;
  for (long long i = 0; i < (long long)(N); i++) {
    long long A;
    cin >> A;
    if (a.count(A))
      a[A]++;
    else {
      v.push_back(A);
      a.emplace(A, 1);
    }
  }
  sort(v.begin(), v.end());
  string out = "No";
  if (v.size() == 1 && v[0] == 0)
    out = "Yes";
  else if (N % 3 == 0) {
    if (v.size() == 2 && v[0] == 0 && a[0] == N / 3)
      out = "Yes";
    else if (v.size() == 3 && (a[v[0]] == a[v[1]] && a[v[1]] == a[v[2]]))
      out = "Yes";
  }
  cout << out << endl;
  return 0;
}
