#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const double EPS = 1e-9;
const double PI = M_PI;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
void yes() { cout << "Yes" << endl; }
void no() { cout << "No" << endl; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> num(n);
  set<long long> S;
  for (long long(i) = 0; (i) < (long long)(n); i++) {
    cin >> num[i];
    S.insert(num[i]);
  }
  if ((long long)S.size() >= 4) {
    no();
  } else {
    if ((long long)S.size() == 1) {
      auto itr = S.begin();
      long long a = (*itr);
      if (a ^ a == a) {
        yes();
      } else {
        no();
      }
    } else if ((long long)S.size() == 2) {
      auto itr = S.begin();
      long long a = (*itr);
      itr++;
      long long b = (*itr);
      int cnta = 0;
      int cntb = 0;
      for (long long(i) = 0; (i) < (long long)(n); i++) {
        if (num[i] == a) {
          cnta++;
        } else {
          cntb++;
        }
      }
      if (2 * cnta == cntb && a ^ b == a) {
        yes();
      } else {
        no();
      }
    } else {
      auto itr = S.begin();
      long long a = (*itr);
      itr++;
      long long b = (*itr);
      itr++;
      long long c = (*itr);
      int cnta = 0;
      int cntb = 0;
      int cntc = 0;
      for (long long(i) = 0; (i) < (long long)(n); i++) {
        if (num[i] == a) {
          cnta++;
        } else if (num[i] == b) {
          cntb++;
        } else {
          cntc++;
        }
      }
      if (max({cnta, cntb, cntc}) == min({cnta, cntb, cntc}) && a ^ b == c) {
        yes();
      } else {
        no();
      }
    }
  }
  return 0;
}
