#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int N, as[(100000)];
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &as[i]);
  }
  map<int, int> a_to_cnt;
  for (int i = 0; i < N; i++) {
    a_to_cnt[as[i]]++;
  }
  int is_yes = 1;
  if (N % 3 == 0) {
    const int M = N / 3;
    for (auto it = a_to_cnt.begin(); it != a_to_cnt.end(); it++) {
      if (it->second % M != 0) {
        is_yes = 0;
      }
    }
  } else {
    for (auto it = a_to_cnt.begin(); it != a_to_cnt.end(); it++) {
      if (it->second != N) {
        is_yes = 0;
      }
    }
  }
  if (is_yes) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
