#include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;
Int n;
bool f() {
  if (n % 3 != 0) {
    bool f = true;
    for (Int i = 0; i < n; ++i) {
      Int a;
      cin >> a;
      if (a != 0) f = false;
    }
    return f;
  }
  vector<Int> v(3, -1), w(3, 0);
  Int a;
  cin >> a;
  v[0] = a;
  w[0] = 1;
  for (Int i = 1; i < n; ++i) {
    cin >> a;
    if (v[0] == a) {
      ++w[0];
      continue;
    }
    if (v[1] == -1) {
      v[1] = a;
      w[1] = 1;
      continue;
    }
    if (v[1] == a) {
      ++w[1];
      continue;
    }
    if (v[2] == -1) {
      v[2] = a;
      w[2] = 1;
      continue;
    }
    if (v[2] == a) {
      ++w[2];
      continue;
    }
    return false;
  }
  if (v[1] == -1) {
    return v[0] == 0;
  } else if (v[2] == -1) {
    return (v[0] == 0 && 2 * w[0] == w[1]) || (w[1] == 0 && 2 * w[1] == w[0]);
  } else {
    return (v[0] == (v[1] ^ v[2])) && (v[1] == (v[2] ^ v[0])) &&
           (v[2] == (v[0] ^ v[1])) && w[0] == w[1] && w[1] == w[2];
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  if (f())
    cout << "Yes\n";
  else
    cout << "No\n";
}
