#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
inline int safe_mul(const int x, const int y)
    __attribute__((warn_unused_result));
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int& x : a) cin >> x;
  map<int, int> cnt;
  for (int x : a) ++cnt[x];
  sort(begin(a), end(a));
  if (cnt.size() > 3) {
    cout << ("No") << '\n';
    exit(0);
  };
  for (const auto& xa : cnt)
    for (const auto& ya : cnt)
      for (const auto& za : cnt) {
        int x = xa.first;
        int y = ya.first;
        int z = za.first;
        if (x ^ y == z && x ^ z == y && y ^ z == x) {
          vector<int> b;
          for (int i = 0; i < n; ++i) {
            b.push_back(x);
            int t = x;
            x = y;
            y = z;
            z = t;
          }
          bool flag = true;
          for (int i = 0; i < n; ++i) {
            if ((a[(i + n - 1) % n] ^ (a[(i + 1) % n])) != a[i]) flag = false;
          }
          if (flag) {
            sort(begin(b), end(b));
            if (a == b) {
              cout << ("Yes") << '\n';
              exit(0);
            };
          }
        }
      }
  {
    cout << ("No") << '\n';
    exit(0);
  }
}
