#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 50;
long long a[M], b[M] = {0};
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int f = 0;
  long long s = a[0];
  long long now = s;
  int w = 0;
  for (int i = 1; i < n; i++) {
    if (find(a, a + n, (s ^ a[i])) - a != n) {
      w = i;
      break;
    }
  }
  if (w == 0) {
    f = 1;
  } else {
    while (a[w] != s) {
      if (find(a, a + n, (now ^ a[w])) - a != n) {
        long long t = now;
        now = a[w];
        w = find(a, a + n, (t ^ a[w])) - a;
      } else {
        f = 1;
        break;
      }
    }
    if (a[w] != s) f = 1;
  }
  if (f == 0)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
