#include <bits/stdc++.h>
const long long MAX = 510000;
const long long mod = 1e9 + 7;
using namespace std;
long long dx[4] = {1, -1, 0, 0};
long long dy[4] = {0, 0, 1, -1};
long long N, M, X, Y, A, B, C, D, Q, K, R, W, H, P, L, G;
long long ans;
string S, T;
long long y[101010];
long long a[201010];
long long k[101010];
long long b[201010];
long long d[101010];
long long t[101010];
long long p[101010];
long long n[101010];
long long l[101010];
long long r[101010];
long long v[101010];
long long s[101010];
long long x[101010];
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
struct Edge {
  long long to, cost;
  Edge(long long to, long long cost) : to(to), cost(cost) {}
};
vector<vector<Edge> > graph;
vector<long long> dist;
struct UnionFind {
  vector<long long> par;
  vector<long long> size;
  UnionFind(long long N) : par(N), size(N) {
    for (long long i = 0; i < N; i++) par[i] = i;
    for (long long i = 0; i < N; i++) size[i] = 1;
  }
  long long root(long long x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  long long GetSize(long long x) { return size[root(x)]; }
  void unite(long long x, long long y) {
    long long rx = root(x);
    long long ry = root(y);
    if (rx == ry) return;
    par[rx] = ry;
    size[ry] += size[rx];
  }
  bool same(long long x, long long y) {
    long long rx = root(x);
    long long ry = root(y);
    return rx == ry;
  }
};
int main() {
  cin >> N;
  map<long long, long long> m;
  for (long long i = (0); i < (N); ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (a[1] == 0 && a[0] == 0) {
    for (long long i = (2); i < (N); ++i) {
      if (a[i] != 0) {
        swap(a[0], a[i]);
      }
    }
  }
  long long old1 = a[0];
  long long old2 = a[1];
  m[a[0]]--;
  m[a[1]]--;
  for (long long i = (2); i < (N); ++i) {
    if (m[old1 ^ old2] >= 1) {
      m[old1 ^ old2]--;
      long long tmp = old1;
      old1 = old2;
      old2 = tmp ^ old2;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (((old1 ^ old2) == a[0]) && ((old2 ^ a[0]) == a[1])) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
