#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  unsigned int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int c[n];
  bool b[n];
  for (int i = 0; i < n; ++i) {
    c[i] = a[i];
  }
  int cnt = 0;
  int lc = 0;
  do {
    if (c[0] == (c[n - 1] ^ c[1])) cnt++;
    for (int i = 1; i < n - 1; ++i) {
      if (c[i] == (c[i - 1] ^ c[i + 1])) cnt++;
    }
    if (c[n - 1] == (c[n - 2] ^ c[0])) cnt++;
    if (n == cnt) {
      cout << "Yes" << endl;
      return 0;
    } else {
      if (lc < 10) {
        for (int i = 0; i < n; ++i) {
          b[i] = false;
        }
        for (int i = 0; i < n; ++i) {
          int r = rand() % n;
          if (b[r] == false) {
            c[i] = a[r];
            b[r] = true;
          }
        }
        lc++;
      } else {
        break;
      }
    }
  } while (1);
  cout << "No" << endl;
  return 0;
}
