#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  if (a[0] == a[N - 1] && a[0] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (a[N / 3 - 1] == 0 && a[N / 3] == a[N - 1]) {
    cout << "Yes" << endl;
    return 0;
  }
  if (a[0] == a[N / 3 - 1] && a[N / 3] == a[N * 2 / 3 - 1] &&
      a[N * 2 / 3] == a[N - 1]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
