#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const ll inf = 1ll << 29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  int N;
  cin >> N;
  vi a(N);
  for (int i = 0; i < (N); i++) cin >> a.at(i);
  vi P(N);
  for (int i = (0); i <= (N - 2); i++) P.at(i) = i;
  do {
    bool exist = true;
    if (a.at(N - 1) != (a.at(P.at(N - 2)) ^ a.at(P.at(0)))) {
      exist = false;
      continue;
    }
    if (a.at(P.at(0)) != (a.at(N - 1) ^ a.at(P.at(1)))) {
      cout << "\"c\""
           << " = " << ("c") << endl;
      ;
      exist = false;
      continue;
    }
    if (a.at(P.at(N - 2)) != (a.at(P.at(N - 3)) ^ a.at(N - 1))) {
      exist = false;
      continue;
    }
    for (int i = (1); i <= (N - 3); i++) {
      if (a.at(P.at(i)) != (a.at(P.at(i - 1)) ^ a.at(P.at(i + 1)))) {
        exist = false;
        break;
      }
    }
    if (exist == true) {
      cout << "Yes" << endl;
      return 0;
    }
  } while (next_permutation((P).begin(), (P).end()));
  cout << "No" << endl;
}
