#include <bits/stdc++.h>
using namespace std;
map<int, int> fr;
void win(bool win) {
  printf("%s\n", win ? "Yes" : "No");
  exit(0);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); ++i) {
    int t;
    scanf("%d", &t);
    ++fr[t];
  }
  if (fr.find(0) != fr.end() && fr[0] == n) win(true);
  if (n % 3 != 0) win(false);
  vector<int> v;
  for (auto it = fr.begin(); it != fr.end(); ++it) v.push_back(it->second);
  if (v.size() > 3 || v.size() == 1) win(false);
  sort(v.begin(), v.end());
  if (v.size() == 3 && v[0] == v[2]) win(true);
  if (v.size() == 2 && v[0] * 2 == v[1]) win(true);
  win(false);
}
