#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, i, y, j;
  int chk = 0;
  cin >> x;
  int* ar = (int*)malloc(x * sizeof(int));
  for (i = 1; i <= x; i++) {
    cin >> y;
    ar[i - 1] = y;
  }
  for (j = 1; j < x; j++) {
    if (j < (x - 1)) {
      if (ar[j] == (ar[j - 1] ^ ar[j + 1])) {
        continue;
      } else {
        cout << "No" << endl;
        chk = 1;
        break;
      }
    } else if (j == (x - 1)) {
      if (ar[j] == (ar[j - 1] ^ ar[0])) {
        continue;
      } else {
        cout << "No" << endl;
        chk = 1;
        break;
      }
    }
  }
  if (chk == 0) {
    cout << "yes" << endl;
  }
}
