#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, cnt = 1, per;
int a[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (n % 3 != 0) {
    printf("No\n");
    return 0;
  }
  per = n / 3;
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == a[i - 1])
      cnt++;
    else {
      if (cnt % per != 0) printf("No\n");
      cnt = 1;
    }
  }
  printf("Yes\n");
  return 0;
}
