#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a;
  map<int, int> As;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a;
    if (As.find(a) != As.end()) {
      As[a] += 1;
    } else {
      As.emplace(a, 1);
    }
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
  } else if (As.size() != 3) {
    cout << "No" << endl;
  } else {
    int flag = 1;
    for (auto itr = As.begin(); itr != As.end(); itr++) {
      if (itr->first != N / 3) flag = 0;
    }
    if (flag == 1) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
