#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using V = vector<int>;
using A = array<int, 2>;
using P = pair<int, int>;
constexpr int MOD{1000000000 + 7};
constexpr array<int, 4> dx{1, 0, -1, 0}, dy{0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
constexpr int div_roundup(int a, int b) { return (a + b - 1) / b; }
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  multiset<int> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  bool can = false;
  for (int i = 1; i < n; i++) {
    multiset<int> ss;
    ss.insert(a[0]);
    ss.insert(a[i]);
    deque<int> dq;
    dq.push_back(a[0]);
    dq.push_back(a[i]);
    for (int j = 2; j < n; j++) {
      const int next = dq.front() ^ dq.back();
      dq.push_back(next);
      ss.insert(next);
      dq.pop_front();
    }
    if (s == ss) {
      can = true;
      break;
    }
  }
  cout << (can ? "Yes" : "No") << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(0);
  solve();
}
