#include <bits/stdc++.h>
using namespace std;
long long modinv(long long a) {
  long long b = ((int)1e9 + 7), u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= ((int)1e9 + 7);
  if (u < 0) u += ((int)1e9 + 7);
  return u;
}
long long exp(long long a, long long b) {
  long long sum = a;
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = (res * sum) % ((int)1e9 + 7);
    }
    sum = (sum * sum) % ((int)1e9 + 7);
    b >>= 1;
  }
  return res;
}
int main() {
  int N;
  cin >> N;
  map<int, int> count;
  vector<int> line(N);
  for (int i = 0; i < (N); ++i) {
    cin >> line[i];
    ++count[line[i]];
  }
  int a = line[0];
  int b = line[1];
  bool flag = true;
  for (int i = 0; i < (N - 2); ++i) {
    if (count.count(a ^ b) > 0) {
      int c = a ^ b;
      --count[c];
      if (count[c] == 0) {
        count.erase(c);
      }
      a = b;
      b = c;
    } else {
      flag = false;
      break;
    }
  }
  if (a ^ b == line[0])
    ;
  else {
    flag = false;
  }
  cout << (flag ? "Yes" : "No") << endl;
  return 0;
}
