#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000000;
int main() {
  int N;
  cin >> N;
  vector<long long> a(N);
  map<long long, int> m;
  for (long long i = 0; i < N; ++i) {
    long long x;
    cin >> x;
    m[x]++;
  }
  bool ans = false;
  if (m.size() == 3 && N % 3 == 0) {
    int c = 0;
    for (auto x : m) {
      if (x.second == N / 3) {
        c++;
      }
    }
    if (c == 3) {
      ans = true;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
