#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  string answer = "Yes";
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      if (a[n - 1] ^ a[1] != a[0]) {
        answer = "No";
      }
    } else if (i == n - 1) {
      if (i == n - 1) {
        if (a[n - 2] ^ a[0] != a[n - 1]) {
          answer = "No";
        }
      }
    } else {
      if (a[i - 1] ^ a[i + 1] != a[i]) {
        answer = "No";
      }
    }
  }
  cout << answer << endl;
  return 0;
}
