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