#include <bits/stdc++.h>
int main(void) {
  int N;
  std::cin >> N;
  std::vector<long long> a(N);
  for (int i = 0; i < N; i++) std::cin >> a[i];
  std::vector<long long> b(N);
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      b[i] = a[N - 1] ^ a[1];
      continue;
    }
    if (i == N - 1) {
      b[i] = a[N - 2] ^ a[0];
      continue;
    }
    b[i] = a[i - 1] ^ a[i + 1];
  }
  for (int i = 0; i < N; i++) {
    if (a[i] != b[i]) {
      std::cout << "No" << std::endl;
      return 0;
    }
  }
  std::cout << "Yes" << std::endl;
  return 0;
}
