#include <bits/stdc++.h>
using namespace std;
bool check(map<int, int> &m, int N) {
  int M = m.size();
  vector<int> k(M);
  vector<int> v(M);
  int i = 0;
  for (auto &p : m) {
    k[i] = p.first;
    v[i] = p.second;
    i++;
  }
  bool ez = (m.find(0) != m.end());
  if (ez && m[0] == N) return true;
  if (N % 3 != 0) return false;
  if (M == 2 && ez && m[0] * 3 == N) return true;
  if (M > 3) return false;
  for (auto &vi : v)
    if (vi * 3 != N) return false;
  return k[0] ^ k[1] == k[2];
}
int main() {
  int N;
  cin >> N;
  map<int, int> m;
  for (int i = 0; i < N; i++) {
    int ai;
    cin >> ai;
    if (m.find(ai) == m.end()) m[ai] = 0;
    m[ai]++;
  }
  cout << (check(m, N) ? "Yes" : "No") << endl;
  return 0;
}
