#include <bits/stdc++.h>
using namespace std;
int n, a[3], t[3];
int main() {
  scanf("%d", &n), a[0] = a[1] = a[2] = -1;
  if (n % 3) return printf("No"), 0;
  for (int i = 1, x, j; i <= n; i++) {
    scanf("%d", &x);
    for (j = 0; j < 3; j++)
      if (a[j] == -1) {
        a[j] = x, ++t[j];
        break;
      } else if (a[j] == x) {
        ++t[j];
        break;
      }
    if (j >= 3) return printf("No"), 0;
  }
  if (t[0] == n / 3 && t[1] == t[0])
    printf("Yes");
  else
    printf("No");
  return 0;
}
