#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  };
  map<long long int, long long int> m;
  for (long long int i = 0; i < n; i++) {
    m[a[i]]++;
  }
  long long int cnt = 0;
  long long int num = m[a[0]];
  for (auto it = m.begin(); it != m.end(); it++) {
    cnt++;
    if (it->second != num) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (cnt % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
