#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);
  n /= 3;
  for (auto it = fr.begin(); it != fr.end(); ++it)
    if (it->second != n) win(false);
  win(true);
}
