#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  for (int i = 0; i < N; ++i) std::cin >> a[i];
  if (N % 3 != 0) {
    for (int i = 0; i < N; ++i) {
      if (a[i] != 0) {
        std::cout << "No" << std::endl;
        return 0;
      }
    }
    std::cout << "Yes" << std::endl;
    return 0;
  }
  std::sort(a.begin(), a.end());
  int count[3] = {0, 0, 0};
  count[0] = std::count(a.begin(), a.end(), a[0]);
  if (count[0] < N)
    count[1] = std::count(a.begin() + count[0], a.end(), a[count[0]]);
  if (count[0] + count[1] < N)
    count[2] = std::count(a.begin() + count[0] + count[1], a.end(),
                          a[count[0] + count[1]]);
  if (count[0] + count[1] + count[2] < N) {
    std::cout << "No" << std::endl;
  } else {
    if (a[0] == 0 && count[0] == N / 3 && count[1] == N * 2 / 3)
      std::cout << "Yes" << std::endl;
    else if (count[0] == count[1] && count[1] == count[2]) {
      if (a[0] ^ a[N / 3] ^ a[N * 2 / 3] == 0)
        std::cout << "Yes" << std::endl;
      else
        std::cout << "No" << std::endl;
    } else
      std::cout << "No" << std::endl;
  }
  return 0;
}
