#include <bits/stdc++.h>
using namespace std;
map<int, int> num;
int a[200005];
int main() {
  int n;
  cin >> n;
  if (n % 3) {
    puts("No");
    return 0;
  }
  for (int i = 1, x; i <= n; ++i) scanf("%d", a + i), num[a[i]]++;
  int ok = 1;
  for (int i = 1; i <= n; ++i)
    if (num[a[i]] != n / 3) ok = false;
  puts(ok ? "Yes" : "No");
  return 0;
}
