#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, tmp;
  cin >> N;
  vector<int> A;
  for (int i = 0; i < N; i++) {
    cin >> tmp;
    A.push_back(tmp);
  }
  bool flag = true;
  for (int i = 0; i < N; i++) {
    int left = (i - 1 + N) % N;
    int right = (i + 1 + N) % N;
    if ((A[left] ^ A[right]) != A[i]) {
      flag = false;
      break;
    }
  }
  cout << (flag ? "Yes" : "No") << endl;
  return 0;
}
