#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;
int n, ans;
int a[100002];
bool judge = true;
map<int, int> mp;
int main() {
  cin >> n;
  for (int i = (int)(0); i < (int)(n); ++i) cin >> a[i];
  if (n % 3 == 0) {
    for (int i = (int)(0); i < (int)(n); ++i) {
      mp[a[i]]++;
    }
    ans = mp[a[0]];
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
      if (itr->second != ans) judge = false;
    }
  } else if (n % 2 == 0) {
    for (int i = (int)(0); i < (int)(n); ++i) {
      mp[a[i]]++;
    }
    ans = mp[a[0]];
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
      if (itr->second % 2 != 0) judge = false;
    }
  } else
    judge = false;
  if (judge)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
