#include <bits/stdc++.h>
using namespace std;
const int N = 200 * 1000 + 17;
const int MOD = 1000 * 1000 * 1000 + 7;
int n;
int a[N];
bool read() {
  if (!(cin >> n)) return false;
  for (int i = 0; i < n; ++i) cin >> a[i];
  return true;
}
void solve() {
  sort(a, a + n);
  if (a[0] == a[n]) {
    if (a[0] == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
    return;
  }
  if (n % 3 != 0) {
    cout << "No\n";
    return;
  }
  for (int i = 0; i < n; ++i)
    if (a[i] != a[i - i % (n / 3)]) {
      cout << "No\n";
      return;
    }
  if (a[0] ^ a[(n / 3)] ^ a[2 * (n / 3)])
    cout << "No\n";
  else
    cout << "Yes\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  while (read()) solve();
  return 0;
}
