#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long mpow(long long a, long long b) {
  if (b == 0) return 1;
  long long t1 = mpow(a, b / 2);
  t1 *= t1;
  t1 %= MOD;
  if (b % 2) t1 *= a;
  t1 %= MOD;
  return t1;
}
void solve(long long index) {
  long long n;
  cin >> n;
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    long long t1;
    cin >> t1;
    m[t1]++;
  }
  if (m.find(0) != m.end() && (long long)m.size() == 1) {
    cout << "Yes"
         << "\n";
  } else if (n % 3) {
    cout << "No"
         << "\n";
  } else if ((long long)m.size() == 2) {
    if (m[0] == n / 3)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  } else if ((long long)m.size() == 3) {
    long long temp = -1;
    bool bo = 1;
    for (auto it : m) {
      if (temp == -1) {
        temp = it.second;
      }
      if (temp != it.second) {
        bo = 0;
      }
    }
    if (bo)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  } else {
    cout << "No"
         << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long i = 0; i < t; i++) solve(i + 1);
  return 0;
}
