#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int kan_hyaku(int n) {
  int kurai = 0;
  for (int i = 0; i < 3; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int kan_ju(int n) {
  int kurai = 0;
  for (int i = 0; i < 2; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int kan_ichi(int n) {
  int kurai = 0;
  for (int i = 0; i < 1; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int keta(int n) {
  int wa = 1;
  while (n > 0) {
    wa *= 10;
    n--;
  }
  return wa;
}
double kan_half(int n) {
  double wa = 1;
  while (n > 0) {
    wa *= 0.5;
    n--;
  }
  return wa;
}
long long facctorialMethod(long long k) {
  long long sum = 1;
  for (long long i = 1; i <= k; ++i) {
    sum = sum % 1000000007 * i % 1000000007;
  }
  return sum;
}
int zorocheck(string s) {
  int count = 0;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s.at(i) == s.at(0)) count++;
  }
  if (count == s.size()) {
    return 1;
  } else {
    return 0;
  }
}
int sannobekijou(int n) {
  int wa = 1;
  while (n > 0) {
    n--;
    wa *= 3;
  }
  return wa;
}
bool red[100010] = {};
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a.at(i);
  long long flag = 0;
  map<long long, long long> mp;
  for (int i = 0; i < (int)(n); i++) {
    mp[a.at(i)]++;
  }
  long long zerohanbetu;
  long long shurui = 0;
  for (auto p : mp) {
    shurui++;
    zerohanbetu = p.first;
  }
  if (shurui == 1 && zerohanbetu == 0) {
    flag = 1;
  } else if (shurui == 3) {
    vector<long long> k(3);
    long long i = 0;
    for (auto p : mp) {
      k.at(i) = p.second;
      i++;
    }
    if (k.at(0) * 3 == n && k.at(1) * 3 == n && k.at(2) * 3 == n) {
      flag = 1;
    }
  } else if (shurui == 2) {
    vector<long long> k(2);
    vector<long long> s(2);
    long long i = 0;
    for (auto p : mp) {
      k.at(i) = p.first;
      s.at(i) = p.second;
      i++;
    }
    if (k.at(0) == 0 && s.at(0) * 3 == n && s.at(1) * 3 / 2 == n) {
      flag = 1;
    }
  }
  if (flag == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
