#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 5;
map<int, int> mp;
int n;
int a[100005];
int main() {
  iostream::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (n % 3) {
    if (mp.size() != 1)
      cout << "No";
    else
      cout << "Yes";
  } else {
    if (mp.size() != 3)
      cout << "No";
    else {
      bool ok = 1;
      for (auto v : mp) ok &= v.second == n / 3;
      if (ok)
        cout << "Yes";
      else
        cout << "No";
    }
  }
}
