#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v(n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  sort(v.begin(), v.end());
  vector<int> cnts;
  for (int i = 0; i < n; i++) {
    int cur = 1;
    while (i + 1 < n && v[i] == v[i + 1]) {
      i++;
      cur++;
    }
    cnts.push_back(cur);
  }
  if (v[0] == 0) {
    if ((((int)cnts.size()) == 2 &&
         min(cnts[0], cnts[1]) * 2 == max(cnts[0], cnts[1])) ||
        ((int)cnts.size()) == 1) {
      printf("Yes");
    } else
      printf("No");
    exit(0);
  }
  if (((int)cnts.size()) != 3 || cnts[0] != cnts[1] || cnts[1] != cnts[2] ||
      cnts[0] != cnts[2]) {
    printf("No");
  } else
    printf("Yes");
}
