#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;
int n, a[maxn];
int cnt[maxn];
map<int, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int tot = 0;
  memset(cnt, -1, sizeof(cnt));
  for (int i = (1); i <= (n); i++) {
    cin >> a[i];
    if (!mp[a[i]]) {
      cnt[tot++] = a[i];
    }
    mp[a[i]]++;
  }
  if (n % 3) {
    if (mp[0] == n)
      cout << "Yes";
    else
      cout << "No";
  } else {
    int flag = 0;
    if (tot == 1 && mp[0] == n) flag = 1;
    if (tot == 2 &&
        (mp[cnt[0]] == 2 * mp[cnt[1]] || mp[cnt[1]] == 2 * mp[cnt[0]]))
      flag = 1;
    if (tot == 3 && mp[cnt[0]] == mp[cnt[1]] && mp[cnt[1]] == mp[cnt[2]])
      flag = 1;
    if (flag)
      cout << "Yes";
    else
      cout << "No";
  }
  return 0;
}
