#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
multiset<int> S;
int n, a[500010], t, l, r, m, b[500010], ts, tmp[500100];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    getint(a[i]);
    tmp[++ts] = a[i];
    S.insert(a[i]);
  }
  sort(tmp + 1, tmp + ts + 1);
  ts = unique(tmp + 1, tmp + ts + 1) - tmp - 1;
  for (int i = 1; i <= n; ++i) {
    ++t;
    if (t > ts) t = 1;
    if (S.find(tmp[t]) == S.end()) return puts("No"), 0;
    b[i] = tmp[t];
    S.erase(S.find(tmp[t]));
  }
  m = n;
  for (int i = 2; i <= m - 1; ++i)
    if (b[i] != (b[i - 1] ^ b[i + 1])) return puts("No"), 0;
  if (b[1] != (b[2] ^ b[m])) return puts("No"), 0;
  if (b[m] != (b[m - 1] ^ b[1])) return puts("No"), 0;
  puts("Yes");
  return 0;
}
