#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  if (n % 3 != 0) {
    cout << "No";
    assert(false);
    return 0;
  }
  long long d = 0;
  for (long long i = 0; i < n; ++i) {
    if (!mp[a[i]]) ++d;
    mp[a[i]]++;
  }
  if (d > 3) {
    cout << "No";
    return 0;
  }
  long long t1 = -1;
  for (auto i : mp) {
    if (i.second != n / 3) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
