#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n,a; cin >> n;
  map<ll,ll> m;
  for (ll i = 0; i < n; ++i) {
    cin >> a; m[a] += 1;
  }
  if (m.size() == 1) {
    if (m.begin()->first == 0) puts("Yes"); else puts("No");
  }
  else if (m.size() == 2) {
    if (m.begin()->first == 0 && N%3 == 0 && m.begin()->second == N/3)
      puts("Yes"); else puts("No");
  }
  else if (m.size() == 3) {
    vector<ll> keys(3); ll pos = 0;
    for (auto itr = m.begin(); itr != m.end(); ++itr) { 
      keys[pos] = itr->first; pos += 1;
    }
    if (m[keys[0]] == m[keys[1]] && m[keys[1]] == m[keys[2]])
      puts("Yes"); else puts("No");
  }
  else puts("No");
  return 0;
}
