#include <bits/stdc++.h>
int main(int argc, char** argv) {
  int N;
  std::cin >> N;
  std::vector<int> va;
  for (int i = 0; i < N; i++) {
    int a;
    std::cin >> a;
    va.push_back(a);
  }
  bool ret = true;
  int b = va[N - 1] ^ va[1];
  ret = ret && b == va[0];
  for (int i = 1; i < N - 1; i++) {
    b = va[i - 1] ^ va[i + 1];
    ret = ret && b == va[i];
  }
  b = va[N - 2] ^ va[0];
  ret = ret && b == va[N - 1];
  if (ret) {
    std::cout << "Yes";
  } else {
    std::cout << "No";
  }
  return 0;
}
