#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
struct Edge {
  long long to, cap, rev;
  Edge(long long _to, long long _cap, long long _rev) {
    to = _to;
    cap = _cap;
    rev = _rev;
  }
};
void add_edge(vector<vector<Edge>>& G, long long from, long long to,
              long long cap, bool revFlag, long long revCap) {
  G[from].push_back(Edge(to, cap, (long long)G[to].size()));
  if (revFlag)
    G[to].push_back(Edge(from, revCap, (long long)G[from].size() - 1));
}
long long max_flow_dfs(vector<vector<Edge>>& G, long long v, long long t,
                       long long f, vector<bool>& used) {
  if (v == t) return f;
  used[v] = true;
  for (int i = 0; i < G[v].size(); ++i) {
    Edge& e = G[v][i];
    if (!used[e.to] && e.cap > 0) {
      long long d = max_flow_dfs(G, e.to, t, min(f, e.cap), used);
      if (d > 0) {
        e.cap -= d;
        G[e.to][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}
long long max_flow(vector<vector<Edge>>& G, long long s, long long t) {
  long long flow = 0;
  for (;;) {
    vector<bool> used(G.size());
    for (long long(i) = 0; (i) < (used.size()); (i)++) used[i] = false;
    long long f = max_flow_dfs(G, s, t, INF, used);
    if (f == 0) {
      return flow;
    }
    flow += f;
  }
}
void Dijkstra(vector<vector<Edge>>& G, long long s, vector<long long>& d) {
  d.resize(G.size());
  for (long long(i) = 0; (i) < (d.size()); (i)++) d[i] = INF;
  d[s] = 0;
  priority_queue<pair<long long, long long>, vector<pair<long long, long long>>,
                 greater<pair<long long, long long>>>
      q;
  q.push(make_pair(0, s));
  while (!q.empty()) {
    pair<long long, long long> a = q.top();
    q.pop();
    if (d[a.second] < a.first) continue;
    for (long long(i) = 0; (i) < (G[a.second].size()); (i)++) {
      Edge e = G[a.second][i];
      if (d[e.to] > d[a.second] + e.cap) {
        d[e.to] = d[a.second] + e.cap;
        q.push(make_pair(d[e.to], e.to));
      }
    }
  }
}
void WarshallFloyd(vector<vector<Edge>>& G, vector<vector<long long>>& d) {
  d.resize(G.size());
  for (long long(i) = 0; (i) < (d.size()); (i)++) d[i].resize(G.size());
  for (long long(i) = 0; (i) < (d.size()); (i)++) {
    for (long long(j) = 0; (j) < (d[i].size()); (j)++) {
      d[i][j] = INF;
    }
  }
  for (long long(i) = 0; (i) < (G.size()); (i)++) {
    for (long long(j) = 0; (j) < (G[i].size()); (j)++) {
      d[i][G[i][j].to] = G[i][j].cap;
    }
  }
  for (long long(i) = 0; (i) < (G.size()); (i)++) {
    for (long long(j) = 0; (j) < (G.size()); (j)++) {
      for (long long(k) = 0; (k) < (G.size()); (k)++) {
        chmin(d[j][k], d[j][i] + d[i][k]);
      }
    }
  }
}
class UnionFind {
  vector<int> data;
  int num;

 public:
  UnionFind(int size) : data(size, -1), num(size) {}
  bool unionSet(int x, int y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y];
      data[y] = x;
      num--;
    }
    return x != y;
  }
  bool findSet(int x, int y) { return root(x) == root(y); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  int size(int x) { return -data[root(x)]; }
  int numSet() { return num; }
};
class Combination {
 public:
  vector<long long> fact;
  vector<long long> inv;
  long long mod;
  long long mod_inv(long long x) {
    long long n = mod - 2;
    long long res = 1LL;
    while (n > 0) {
      if (n & 1) res = res * x % mod;
      x = x * x % mod;
      n >>= 1;
    }
    return res;
  }
  long long nCr(long long n, long long r) {
    return ((fact[n] * inv[r] % mod) * inv[n - r]) % mod;
  }
  long long nPr(long long n, long long r) {
    return (fact[n] * inv[n - r]) % mod;
  }
  Combination(long long n, long long _mod) {
    mod = _mod;
    fact.resize(n + 1);
    fact[0] = 1;
    for (long long(i) = 0; (i) < (n); (i)++) {
      fact[i + 1] = (fact[i] * (i + 1LL)) % mod;
    }
    inv.resize(n + 1);
    for (long long(i) = 0; (i) < (n + 1); (i)++) {
      inv[i] = mod_inv(fact[i]);
    }
  }
};
void divisor(long long n, vector<long long>& ret) {
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
}
void factoring(long long i, map<long long, long long>& mp) {
  long long x = i;
  for (int j = 2; j <= i; j++) {
    if (x % j == 0) {
      if (mp.find(j) == mp.end()) {
        mp[j] = 0;
      }
      while (x % j == 0 && x > 1) {
        mp[j]++;
        x /= j;
      }
    }
    if (x == 1) break;
  }
}
long long gcd(long long m, long long n) {
  if (n == 0) return m;
  return gcd(n, m % n);
}
long long lcm(long long m, long long n) { return m / gcd(m, n) * n; }
long long pow2(long long x, long long n, long long mod) {
  long long ans = 1ll;
  while (n > 0) {
    if ((n & 1) == 1) {
      ans = ans * x % mod;
    }
    x = x * x % mod;
    n >>= 1;
  }
  return ans;
}
class MedSet {
 public:
  multiset<long long> left, right;
  long long med;
  MedSet() {}
  MedSet(long long _med) {}
  void insert(long long a) {
    if (left.size() == 0) {
      med = a;
      left.insert(med);
    } else {
      if (a < med) {
        left.insert(a);
        if (left.size() > right.size() + 1) {
          right.insert(*(--left.end()));
          left.erase(--left.end());
        }
        med = *(--left.end());
      } else {
        right.insert(a);
        if (right.size() > left.size()) {
          left.insert(*(right.begin()));
          right.erase(right.begin());
        }
        med = *(--left.end());
      }
    }
  }
};
long long N, M, L, R, K, A, B, C, D, Q, X, H, W;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  vector<long long> a(N, 0);
  map<long long, long long> mp;
  for (long long(i) = 0; (i) < (N); (i)++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp.find(0) != mp.end()) {
    if (mp.size() == 1) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  bool flag = false;
  if (mp.size() == 2) {
    auto it = mp.find(0);
    if (it != mp.end()) {
      if (it->second == mp.size() / 3 * 2) {
        flag = true;
      }
    }
  } else if (mp.size() == 3) {
    flag = true;
    vector<long long> b;
    for (auto i : mp) {
      if (i.second != N / 3) flag = false;
      b.push_back(i.first);
    }
    if (flag) {
      if ((b[0] ^ b[1] ^ b[2]) != 0) {
        flag = false;
      }
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
