#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
const int N = 100005;
map<long long, long long> m;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i <= n - 1; i++) {
    cin >> v[i];
    m[v[i]]++;
  }
  long long c = v[0], d = v[1];
  long long i = 2;
  m[v[0]]--;
  m[v[1]]--;
  while (i < n) {
    if (m[c ^ d]) {
      m[c ^ d]--;
      long long temp = c ^ d;
      c = d;
      d = temp;
    } else {
      cout << "No";
      return;
    }
    i++;
  }
  for (long long i = 0; i <= n - 1; i++) {
    m[v[i]]++;
  }
  c = v[1], d = v[2];
  i = 2;
  m[v[1]]--;
  m[v[2]]--;
  while (i < n) {
    if (m[c ^ d]) {
      m[c ^ d]--;
      long long temp = c ^ d;
      c = d;
      d = temp;
    } else {
      cout << "No";
      return;
    }
    i++;
  }
  for (long long i = 0; i <= n - 1; i++) {
    m[v[i]]++;
  }
  c = v[0], d = v[2];
  i = 2;
  m[v[0]]--;
  m[v[2]]--;
  while (i < n) {
    if (m[c ^ d]) {
      m[c ^ d]--;
      long long temp = c ^ d;
      c = d;
      d = temp;
    } else {
      cout << "No";
      return;
    }
    i++;
  }
  cout << "Yes";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    solve();
  }
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
