#include <stdio.h>
#include <algorithm>
#include <unordered_map>
using namespace std;

bool Check(std::unordered_map<int, int>& dict) {
  if (dict.size() == 1 && dict.count(0)) {
    return true;
  }
  if (dict.size() == 2) {
    int x = dict.begin()->first, y = (dict.begin() + 1)->first;
    if (dict[x] > dict[y]) {
    	std::swap(x, y);
    }
    if (dict[x] * 2 == dict[y] && x == 0) {
      return true;
    }
  }
  if (dict.size() == 3) {
    int x = dict.begin()->first;
    int y = (dict.begin() + 1)->first;
    int z = (dict.begin() + 2)->first;
    if (dict[x] == dict[y] && dict[x] == dict[z] && ((x ^ y) == z)) {
      return true;
    }
  }
  return false;
}

int main() {
  int n;
  std::unordered_map<int, int> dict;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    dict[x]++;
  }
  if (Check(dict)) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}