#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  map<long long int, long long int> arr;
  vector<long long int> v;
  for (int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    if (arr[a] == 0) {
      v.push_back(a);
    }
    arr[a] = arr[a] + 1;
  }
  if (arr.size() == 3) {
    auto it = arr.begin();
    long long int prev = it->second;
    it++;
    while (it != arr.end()) {
      if (it->second != prev) {
        cout << "No";
        return 0;
      }
      it++;
    }
    cout << "Yes";
  } else {
    cout << "No";
  }
}
