#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int a[n];
  map<int, int> c;
  int M = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    c[a[i]]++;
    if (M < a[i]) {
      M = a[i];
    }
  }
  bool flg = true;
  for (int i = 1; i <= M; i++) {
    if (c[i] == 0 || c[i] == n / 3) {
    } else {
      flg = false;
    }
  }
  if ((n % 3 != 0) || !flg) {
    cout << "No";
  } else {
    cout << "Yes";
  }
}
