#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n; cin >> n;
  map<long long, int> mp;
  REP(i, n) {
    int a; cin >> a;
    ++mp[a];
  }
  if (n % 3 != 0) {
    cout << (mp.size() == 1 && mp.count(0) ? "Yes\n" : "No\n";
    return 0;
  }
  if (mp.size() == 2) {
    cout << (mp.count(0) && mp[0] == n / 3 && (*mp.rbegin()).second == 2 * n / 3 ? "Yes\n" : "No\n");
    return 0;
  }
  if (mp.size() == 3) {
    bool ok = true;
    for (auto p : mp) {
      if (p.second != n / 3) ok = false;
    }
    cout << (ok ? "Yes\n" : "No\n");
    return 0;
  }
  cout << "No\n";
  return 0;
}
