#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.05e9;
int main() {
  int n;
  vector<int> as;
  map<int, int> counts;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    counts[a] += 1;
    as.push_back(a);
  }
  sort(as.begin(), as.end());
  as.erase(unique(as.begin(), as.end()), as.end());
  bool ok = false;
  if (as.size() == 3) {
    int x = as[0];
    int y = as[1];
    int z = as[2];
    ok = (x ^ y == z) && (n % 3 == 0) && (counts[x] == counts[y]) &&
         (counts[y] == counts[z]);
  }
  if (as.size() == 2) {
    int x = as[0];
    int y = as[1];
    ok = (x == 0) && (n % 3 == 0) && (counts[y] == counts[x] * 2);
  }
  if (as.size() == 1) {
    int x = as[0];
    ok = (x == 0);
  }
  printf("%s\n", ok ? "Yes" : "No");
  return 0;
}
