#include <bits/stdc++.h>
constexpr long long mod = 1e9 + 7;
using namespace std;
long long A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
long long ans = 0;
int main() {
  cin >> N;
  vector<int> a(N);
  set<int> set;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    set.insert(a[i]);
  }
  if (set.size() == 3 && N % 3 == 0) {
    int i = 0;
    int x[3];
    for (auto tmp : set) {
      x[i] = tmp;
      i++;
    }
    if (count(a.begin(), a.end(), x[0]) == N / 3 &&
        count(a.begin(), a.end(), x[1]) == N / 3) {
      cout << "Yes" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
