#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
template <class T, class U>
void amax(T& x, U y) {
  if (x < y) x = y;
}
template <class T, class U>
void amin(T& x, U y) {
  if (x > y) x = y;
}
const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (N); ++i) cin >> a[i];
  bool result = false;
  if (N % 3 == 0) {
    sort((a).begin(), (a).end());
    bool b0 =
        all_of(a.begin(), a.begin() + N / 3, [&](int x) { return x == a[0]; });
    bool b1 = all_of(a.begin() + N / 3, a.begin() + 2 * N / 3,
                     [&](int x) { return x == a[N / 3]; });
    bool b2 = all_of(a.begin() + 2 * N / 3, a.end(),
                     [&](int x) { return x == a[2 * N / 3]; });
    int x = a[0], y = a[N / 3], z = a[2 * N / 3];
    result = b0 && b1 && b2 && x == (y ^ z) && y == (z ^ x) && z == (x ^ y);
  } else {
    result = all_of((a).begin(), (a).end(), [](int x) { return x = 0; });
  }
  cout << (result ? "Yes" : "No") << endl;
  return 0;
}
