#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, k = 0, m, p, f = 0, a[3], x, y, z;
  cin >> n;
  unordered_map<long long, long long> mp;
  a[0] = 0, a[1] = 0, a[2] = 0;
  for (i = 0; i < n; i++) {
    cin >> j;
    if (mp[j] == 0) {
      k++;
      if (k >= 4) {
        f = 1;
      } else {
        a[k - 1] = j;
      }
    }
    mp[j]++;
  }
  if (f == 1) {
    cout << "No" << endl;
  } else {
    x = mp[a[0]];
    y = mp[a[1]];
    z = mp[a[2]];
    if (z == 0 && y == 0) {
      if (a[0] == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (z == 0) {
      if (x < y) swap(x, y), swap(a[0], a[1]);
      if (a[1] != 0)
        cout << "No" << endl;
      else {
        z = x / 2;
        x = x - z;
        if (z <= y) {
          if (x - z < 2 && y - z < 2)
            cout << "Yes" << endl;
          else
            cout << "No" << endl;
        } else {
          if (x - y < 2 && z - y < 2)
            cout << "Yes" << endl;
          else
            cout << "No" << endl;
        }
      }
    } else {
      if (a[0] ^ a[1] ^ a[2] == 0) {
        if (x <= y && x <= z) {
          if (z - x < 2 && y - x < 2)
            cout << "Yes" << endl;
          else
            cout << "No" << endl;
        } else if (y <= x && y <= z) {
          if (x - y < 2 && z - y < 2)
            cout << "Yes" << endl;
          else
            cout << "No" << endl;
        } else {
          if (x - z < 2 && y - z < 2)
            cout << "Yes" << endl;
          else
            cout << "No" << endl;
        }
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
