#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
long long pow(long long a, int b) {
  return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1;
}
template <typename T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  for (int i = 0; i < (n - 1); ++i) {
    auto it = lower_bound(a.begin(), a.end(), a[i] ^ a[i + 1]) - a.begin();
    if (it == (int)a.size()) break;
    if (a[it] != (a[i] ^ a[i + 1])) break;
    if (i == n - 2) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
