#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long GCD(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return GCD(y, x % y);
}
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
const int MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool b = true;
  for (int i = 1; i < n - 1; i++) {
    if (a[i] != (long long)(a[i - 1] ^ a[i + 1])) {
      b = false;
      break;
    }
  }
  if (a[0] != (long long)(a[1] ^ a[n - 1])) b = false;
  if (a[n - 1] != (long long)(a[0] ^ a[n - 2])) b = false;
  if (b) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
