#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
using graph = vector<vector<ll>>;
const long long inf = 2147483647;
const ll INF = 9223372036854775807;
signed main() {
  map<long long, long long> m;
  long long n;
  cin >> n;
  for (ll i = 0; i < n; i++) {
    long long t;
    cin >> t;
    m[t]++;
  }
  bool flag = false;
  if (m.size() == 3 && n % 3 == 0) {
    long long t = n / 3;
    for (auto i : m) {
      cout << i.second << "\n";
      if (i.second == t)
        flag = true;
      else {
        flag = false;
        break;
      }
    }
  }
  if (m[0] == n || m.size() == 2 && n % 3 == 0 && m[0] == n / 3) {
    flag = true;
  }
  cout << (flag ? "Yes" : "No") << "\n";
  return 0;
}
