#include <bits/stdc++.h>
using namespace std;
map<int, int> ava, use;
int n, a[100100];
bool solve(int a, int b, int x) {
  if (x == n + 1) return true;
  if (ava[a ^ b] == 0) return false;
  if (use[a ^ b] == 1)
    return false;
  else {
    use[a ^ b] = 1;
    return solve(b, a ^ b, x + 1);
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    ava[a[i]] = 1;
  }
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      use.clear();
      use[a[i]] = 1;
      use[a[j]] = 1;
      if (solve(a[i], a[j], 3) == true) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}
