#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  map<long long, long long> M;
  for (long long i = (long long)(0); i < (long long)(N); i++) {
    long long X;
    cin >> X;
    M[X]++;
  }
  string ans = "No";
  if (N % 3 == 0 && M.size() == 1)
    ans = "Yes";
  else if (N % 3 == 0 && M.size() == 3) {
    vector<long long> A(3);
    long long i = 0;
    for (auto p : M) A[i++] = p.second;
    if (A[0] == A[1] && A[1] == A[2]) ans = "Yes";
  }
  cout << ans << endl;
}
