#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<int> A;
  A.reserve(N);
  std::cin.ignore();
  int n = N;
  while (n > 0) {
    int v;
    std::cin >> v;
    A.push_back(v);
    --n;
  }
  bool find = A[0] == (A[N - 1] ^ A[1]);
  for (int i = 1; find && (i < N - 1); ++i) {
    find = A[i] == (A[i - 1] ^ A[i + 1]);
  }
  find = A[N - 1] == (A[N - 2] ^ A[0]);
  std::cout << (find ? "Yes" : "No") << std::flush;
}
