#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 1;
int A[MAX_N];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  set<int> S;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    S.insert(A[i]);
  }
  if (S.size() == 1) {
    if (A[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (S.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> cnt;
  for (int i = 0; i < N; i++) {
    cnt[A[i]]++;
  }
  if (S.size() == 2) {
    if (cnt[0] == N / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  for (auto i = cnt.begin(); i != cnt.end(); i++) {
    if (i->second != N / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
