#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline long long int rand(long long int x, long long int y) {
  ++y;
  return (rng() % (y - x)) + x;
}
string to_string(char c) {
  string second(1, c);
  return second;
}
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void degug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void degug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  degug_out(T...);
}
inline long long int gcd(long long int a, long long int b) {
  if (a > b) swap(a, b);
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int n, A[(300006)];
map<long long int, long long int> mp;
vector<long long int> d;
vector<long long int> pos[(300006)];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long int i = 0; i < (long long int)n; ++i) cin >> A[i];
  for (long long int i = 1; i < (long long int)n; ++i) mp[A[i]] = i;
  long long int a = A[0], b = -1, c = -1;
  for (long long int i = 1; i < (long long int)n; ++i) {
    if (mp[A[0] ^ A[i]] && mp[A[0] ^ A[i]] != i) {
      b = A[i];
      c = A[0] ^ A[i];
    }
  }
  if (b == -1) {
    cout << "No\n";
    return 0;
  }
  for (long long int i = 0; i < (long long int)n; ++i) d.push_back(A[i]);
  sort((d).begin(), (d).end());
  d.resize(unique((d).begin(), (d).end()) - d.begin());
  for (long long int i = 0; i < (long long int)n; ++i)
    pos[lower_bound((d).begin(), (d).end(), A[i]) - d.begin()].push_back(i);
  vector<long long int> v;
  v.push_back(a), v.push_back(b), v.push_back(c);
  if (n == 3) {
    cout << "Yes\n";
    return 0;
  }
  while (v.size() != n - 1) {
    long long int a = v[v.size() - 2], b = v[v.size() - 1];
    auto p = lower_bound((d).begin(), (d).end(), a ^ b);
    if (*p != (a ^ b)) {
      cout << "No\n";
      return 0;
    }
    if (pos[p - v.begin()].empty()) {
      cout << "No\n";
      return 0;
    }
    pos[p - v.begin()].pop_back();
    v.push_back(a ^ b);
  }
  if (pos[v[0] ^ v.back()].empty()) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
}
