#include <bits/stdc++.h>
using namespace std;
void Yn(bool b) {
  if (b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  if (n % 3 != 0)
    Yn(a.back() == 0);
  else {
    set<long long> s(a.begin(), a.end());
    vector<long long> mem(s.begin(), s.end());
    if (s.size() != 3)
      Yn(false);
    else {
      vector<long long> count(3, 0);
      for (auto x : a) {
        for (long long i = 0; i < 3; ++i) {
          if (x == mem[i]) count[i]++;
        }
      }
      sort(count.begin(), count.end());
      Yn(count.front() == count.back());
    }
  }
}
