#include <bits/stdc++.h>
int main() {
  int number;
  std::cin >> number;
  std::vector<int> anArray(number);
  for (int i = 0; i < number; i++) {
    std::cin >> anArray[i];
  }
  bool check = false;
  for (int j = 0; j < number; j++) {
    if (j == 0) {
      int checkNumber = anArray[j + 1] ^ anArray[number - 1];
      if (anArray[j] == checkNumber) {
        check = true;
      } else {
        check = false;
      }
    } else if (j == number - 1) {
      int checkNumber = anArray[j - 1] ^ anArray[0];
      if (anArray[j] == checkNumber) {
        check = true;
      } else {
        check = false;
      }
    } else {
      int checkNumber = anArray[j - 1] ^ anArray[j + 1];
      if (anArray[j] == checkNumber) {
        check = true;
      } else {
        check = false;
      }
    }
  }
  if (check) {
    std::cout << "Yes" << std::endl;
  } else {
    std::cout << "No" << std::endl;
  }
  return 0;
}
