#include <bits/stdc++.h>
using namespace std;
const unsigned int mod = 1e9 + 7;
const int mx = 1000005;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n];
  int ok = 1;
  for (long long int(i) = 0; (i) < (n); ++(i)) cin >> a[i];
  sort(a, a + n);
  if (a[0] ^ a[n - 2] == a[n - 1])
    ;
  else
    ok = 0;
  if (a[1] ^ a[n - 1] == a[0])
    ;
  else
    ok = 0;
  for (int i = 1; i < n - 1; ++i) {
    if (((a[i - 1]) ^ (a[i + 1])) == a[i])
      ;
    else
      ok = 0;
  }
  int fc = 0;
  while (fc < 25005) {
    ++fc;
    swap(a[rand() % n], a[rand() % n]);
    int yark = 1;
    if (a[0] ^ a[n - 2] == a[n - 1])
      ;
    else
      yark = 0;
    if (a[1] ^ a[n - 1] == a[0])
      ;
    else
      yark = 0;
    for (int i = 1; i < n - 1; ++i) {
      if (((a[i - 1]) ^ (a[i + 1])) == a[i])
        ;
      else
        yark = 0;
    }
    if (yark) {
      cout << "Yes" << '\n';
      return 0;
    }
  }
  if (ok)
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
  return 0;
}
