#include <bits/stdc++.h>
using namespace std;
const long long MOD = pow(10, 9) + 7;
long long mod(long long A, long long M) { return (A % M + M) % M; }
const long long INF = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T>
bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
long long divCeil(long long A, long long B) { return (A + (B - 1)) / B; }
long long myctoi(char C) { return C - 48; }
char myitoc(long long N) { return '0' + N; }
signed main() {
  long long N;
  cin >> N;
  map<long long, long long> mp;
  for (long long i = 0; i < N; i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() == 3) {
    auto it = mp.begin();
    long long a0 = it->first;
    long long a1 = it->second;
    it++;
    long long b0 = it->first;
    long long b1 = it->second;
    it++;
    long long c0 = it->first;
    long long c1 = it->second;
    if (((a0 ^ b0) == c0) && a1 == b1 && b1 == c1) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (mp.size() == 2) {
    auto it = mp.begin();
    long long a0 = it->first;
    long long a1 = it->second;
    it++;
    long long b0 = it->first;
    long long b1 = it->second;
    if ((a0 == 0 && 0 <= b1 - a1 && b1 - a1 <= 1) ||
        (b0 == 0 && 0 <= a1 - b1 && a1 - b1 <= 1)) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (mp.size() == 1 && mp.begin()->first == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
