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