#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, a[N];
map<int, int> cnt, now;
void No() {
  puts("No");
  exit(0);
}
bool check(int x, int y) {
  now = cnt;
  a[1] = x, a[2] = y;
  if (now[x] == 1) return 0;
  --now[x], --now[y];
  for (int i = 3; i <= n; i++) {
    int cur = a[i - 1] ^ a[i - 2];
    if (!now[cur]) return 0;
    --now[cur];
  }
  if ((a[n] ^ a[n - 1] ^ a[1]) != 0) return 0;
  if ((a[n] ^ a[1] ^ a[2]) != 0) return 0;
  return 1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) a[i] = gi(), ++cnt[a[i]];
  if (cnt.size() >= 4) No();
  for (auto x : cnt)
    for (auto y : cnt)
      if (check(x.first, y.first)) return puts("Yes"), 0;
  No();
  return 0;
}
