#include <bits/stdc++.h>
static const long long MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  for (int i = 0; i < (int)(n); i++) {
    if (i + 2 == n) {
      if (a[i + 1] != (a[i] ^ a[0])) {
        cout << "No";
        return 0;
      }
    } else if (i + 2 == n + 1) {
      if (a[0] != (a[i] ^ a[1])) {
        cout << "No";
        return 0;
      }
    } else {
      if (a[i + 1] != (a[i] ^ a[i + 2])) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
  return 0;
}
