#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = 1ll << 61;
long long a[100006];
signed main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  if (n % 3 == 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;
    } else
      cout << "No" << endl;
  } else {
    if (a[0] == a[n - 1] && a[n - 1] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
