#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a, int64_t b) { return b != 0 ? gcd(b, a % b) : a; }
int64_t lcm(int64_t a, int64_t b) { return a * b / gcd(a, b); }
int ctoi(char c) { return c - '0'; }
int main() {
  int64_t n;
  cin >> n;
  vector<int64_t> vec(n);
  int64_t f, s, t;
  f = INT_MIN;
  s = INT_MIN;
  t = INT_MIN;
  for (int i = 0; i < (n); i++) {
    cin >> vec.at(i);
  }
  int64_t fc = 0;
  int64_t sc = 0;
  int64_t tc = 0;
  int64_t oc = 0;
  for (int i = 0; i < (n); i++) {
    if (f == INT_MIN) {
      f = vec.at(i);
      fc++;
    } else if (vec.at(i) == f) {
      fc++;
    } else if (s == INT_MIN) {
      s = vec.at(i);
      sc++;
    } else if (vec.at(i) == s) {
      sc++;
    } else if (t == INT_MIN) {
      t = vec.at(i);
      tc++;
    } else if (vec.at(i) == t) {
      tc++;
    } else {
      oc++;
    }
  }
  if (((f ^ s) ^ t) == 0 && ((s ^ t) ^ f) == 0 && ((t ^ f) ^ s) == 0) {
    if (fc == sc && sc == tc && oc == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
