#include <bits/stdc++.h>
using namespace std;
using PII = pair<int, int>;
using LL = long long;
map<int, int> mp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (mp.find(x) != mp.end())
      mp[x]++;
    else
      mp[x] = 1;
  }
  if (mp.size() != 3)
    cout << "No\n";
  else {
    int ans = mp.begin()->second;
    for (auto p : mp) {
      if (p.second != ans) {
        cout << "No\n";
        return 0;
      }
    }
    cout << "Yes\n";
  }
  return 0;
}
