#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "inline")
using namespace std;
long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return f ? -x : x;
}
const int N = 100005;
int n;
int a[N];
map<int, int> mp;
int main() {
  n = read();
  if (n % 3) return puts("No"), 0;
  for (int i = (1); i <= (n); i++) mp[a[i] = read()]++;
  for (int i = (1); i <= (n); i++)
    if (mp[a[i]] != n / 3) return puts("No"), 0;
  puts("Yes");
  return 0;
}
