#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int t, n, a[N], b[N], num[N], tot, c;
map<int, int> cnt, tmp;
void solve() {
  if (tot > 3) {
    puts("No");
    return;
  } else if (tot == 1) {
    if (num[0] == 0) {
      puts("Yes");
      return;
    } else {
      puts("No");
      return;
    }
  } else {
    bool ok = 1;
    do {
      ok = 1;
      tmp = cnt;
      b[1] = num[0];
      tmp[num[0]]--;
      b[2] = num[1];
      tmp[num[1]]--;
      for (int i = 3; i <= n && ok; ++i) {
        bool upd = 0;
        for (int j = 0; j < 3 && !upd; ++j) {
          if (tmp[num[j]] > 0 && (num[j] ^ b[i - 2]) == b[i - 1]) {
            b[i] = num[j];
            tmp[num[j]]--;
            upd = 1;
          }
        }
        if (!upd) ok = 0;
      }
      if (ok && (b[n] ^ b[n - 1]) != b[1]) ok = 0;
      if (ok) break;
    } while (num, num + tot);
    if (ok)
      puts("Yes");
    else
      puts("No");
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (!cnt.count(a[i])) num[tot++] = a[i];
    cnt[a[i]]++;
  }
  solve();
  return 0;
}
