#include <bits/stdc++.h>
using namespace std;
int n, a[120000], q[120000], m, b[10];
map<int, int> vis, mp;
void solve(int x, int y) {
  mp.clear();
  b[0] = x;
  b[1] = y;
  b[2] = x ^ y;
  for (int i = 0; i < n; ++i) {
    ++mp[b[i % 3]];
  }
  if (mp[b[0]] == vis[b[0]] && mp[b[1]] == vis[b[1]] && mp[b[2]] == vis[b[2]]) {
    puts("Yes");
    exit(0);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    if (!vis[a[i]]) q[++m] = a[i];
    ++vis[a[i]];
  }
  if (m > 3) {
    puts("No");
    return 0;
  }
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= m; ++j) solve(q[i], q[j]);
  return 0;
}
