#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;
int main(void) {
  int N;
  vector<int> a(100010);
  long long x = 0;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  bool flag = false;
  if (N % 3 != 0)
    flag = true;
  else {
    vector<int> b(a);
    sort(b.begin(), b.begin() + N);
    auto itr = unique(b.begin(), b.begin() + N);
    b.erase(itr, b.end());
    if (b.size() > 3)
      flag = true;
    else if (b.size() == 3) {
      if (b[0] != (b[1] ^ b[2]) || b[1] != (b[0] ^ b[2]) ||
          b[2] != (b[0] ^ b[1]))
        flag = true;
    } else if (b.size() == 2) {
      if (b[0] != 0)
        flag = true;
      else if (count(a.begin(), a.begin() + N, b[1]) != 2 * N / 3)
        flag = true;
    } else {
      if (b[0] != 0) flag = true;
    }
  }
  if (flag)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
