#include <bits/stdc++.h>
using namespace std;
int n;
int a[100000];
bool f = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  if (n % 3 == 0) {
    if (a[0] == a[n / 3 - 1] && a[n / 3] == a[n / 3 * 2 - 1] &&
        a[n / 3 * 2] == a[n - 1])
      f = 1;
  }
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
