#include <bits/stdc++.h>
using namespace std;
int dfs(int u, int *a, int t, int n, int *ban, int co) {
  int ban_cp[n], ans = -100;
  co += 1;
  memcpy(ban_cp, ban, sizeof(ban));
  ban_cp[t] = 1;
  if (co == n) {
    return a[t];
  }
  for (int i = 0; i < n; i++) {
    if (a[t] == a[i] ^ u && ban_cp[i] == 0) {
      ans = dfs(a[t], a, i, n, ban_cp, co);
    }
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  int a[n], u, ban[n], co = 0, ans;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    ban[i] = 0;
  }
  u = a[0];
  ban[0] = 1;
  for (int i = 0; i < n; i++) {
    ans = dfs(u, a, i, n, ban, co);
    if (ans != -100 && u == ans ^ a[i]) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
  return 0;
}
