#include <bits/stdc++.h>
using namespace std;
unsigned long long int XOR(unsigned long long int a, unsigned long long int b) {
  unsigned long long int ans = 0;
  for (unsigned long long int x = 1; x <= a * 2 || x <= b * 2; x *= 2) {
    unsigned long long int A = a % x, B = b % x;
    if (A == B) {
      continue;
    } else if (A < B) {
      unsigned long long int z = x / 2;
      ans += z;
      b -= z;
    } else {
      unsigned long long int z = x / 2;
      ans += z;
      a -= z;
    }
  }
  return ans;
}
bool find(unsigned long long int n, unsigned long long int x,
          unsigned long long int a[], unsigned long long int b[]) {
  for (unsigned long long int i = 0; i < n; ++i) {
    for (unsigned long long int j = 0; j < x; ++j) {
      if (a[i] == b[j]) {
        b[j] = -1;
        continue;
      }
      return false;
    }
  }
  return true;
}
int main() {
  unsigned long long int n, x = 1, c = 0;
  cin >> n;
  for (unsigned long long int i = n; 1 < i; --i) {
    x *= i;
  }
  unsigned long long int a[n], b[x];
  for (unsigned long long int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (unsigned long long int i = 0; i < n; ++i) {
    for (unsigned long long int j = i + 1; j < n; ++j) {
      b[c] = XOR(a[i], a[j]);
      ++c;
    }
  }
  if (find(n, x, a, b)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
