#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int count[3];
  count[0] = count[1] = count[2] = -1;
  int cnt[3];
  int yes = 1;
  for (int i = 0; i < n; i++) {
    int u;
    scanf("%d", &u);
    int ok = 0;
    for (int j = 0; j < 3; j++) {
      if (count[j] == -1) {
        count[j] = u;
        cnt[j] = 1;
        ok = 1;
        break;
      } else if (count[j] == u) {
        cnt[j]++;
        ok = 1;
        break;
      }
    }
    if (ok)
      continue;
    else {
      yes = 0;
      break;
    }
  }
  int now = cnt[0];
  for (int i = 0; i < 3; i++) {
    if (count[i] == -1 || cnt[i] != now) yes = 0;
  }
  if (!yes || n % 3)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}
