#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long n, i, flag = 0, ans;
  cin >> n;
  long camel[n];
  for (i = 0; i < n; i++) {
    cin >> camel[i];
  }
  for (i = 0; i < n; i++) {
    if (i - 1 < 0) {
      ans = camel[n - 1] ^ camel[i + 1];
    } else if (i + 1 == n) {
      ans = camel[i - 1] ^ camel[0];
    } else {
      ans = camel[i - 1] ^ camel[i + 1];
    }
    if (ans != camel[i]) {
      flag++;
      break;
    }
  }
  if (flag <= 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
