#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
int a[N];
bool stg() {
  map<int, int> mp;
  vector<int> v;
  for (int i = 1; i <= n; ++i) {
    mp[a[i]]++;
  }
  if (mp.size() > 3) {
    return false;
  }
  for (int i = 1; i <= n; ++i) {
    int maxu = -1, maxi = 0;
    for (map<int, int>::iterator it = mp.begin(); it != mp.end(); ++it) {
      if (it->second > maxu) {
        maxu = it->second;
        maxi = it->first;
      }
    }
    a[i] = maxi;
    mp[a[i]]--;
  }
  for (int i = 1; i <= n; ++i) {
    if (i == 1) {
      if ((a[n] ^ a[i + 1]) != a[i]) return false;
    } else if (i == n) {
      if ((a[1] ^ a[i - 1]) != a[i]) return false;
    } else {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) return false;
    }
  }
  return true;
}
bool stg0() {
  sort(a + 1, a + n + 1);
  do {
    bool z = true;
    for (int i = 1; i <= n; ++i) {
      if (i == 1) {
        if ((a[n] ^ a[i + 1]) != a[i]) {
          z = false;
          break;
        }
      } else if (i == n) {
        if ((a[1] ^ a[i - 1]) != a[i]) {
          z = false;
          break;
        }
      } else {
        if ((a[i - 1] ^ a[i + 1]) != a[i]) {
          z = false;
          break;
        }
      }
    }
    if (z) return true;
  } while (a + 1, a + n + 1);
  return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  if (stg())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
  while (1) {
    n = 5;
    for (int i = 1; i <= n; ++i) {
      a[i] = (rand() % 16);
    }
    if (stg() != stg0()) cout << "WA" << endl;
  }
  return 0;
}
