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