#include <bits/stdc++.h>
using namespace std;
unsigned long long int a, b, c, cnt, cn, ct;
int main() {
  cin >> a;
  unsigned long long int ar[a];
  for (int i = 0; i < a; i++) {
    cin >> c;
    ar[c]++;
    if (ar[c] % 4 == 0) cn++;
    if (ar[c] % 2 == 0)
      ;
    ct++;
  }
  if (ct > a - cn - ct || !cn && ct == a / 2)
    cout << "Yes";
  else
    cout << "No";
}
