#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long f = 1, x = 0;
  char c = getchar();
  while (c < '0' || '9' < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') x = (x << 3) + (x << 1) + c - '0', c = getchar();
  return f * x;
}
int cnt[10];
long long a[80000 + 5], b[80000 + 5];
int main() {
  int T = 1;
  while (T--) {
    int n = read();
    memset(cnt, 0, sizeof(cnt));
    bool f = 1;
    for (int i = 1; i <= n; i++) {
      b[i] = a[i] = read();
      if (a[i]) f = 0;
    }
    if (f) {
      puts("Yes");
      continue;
    }
    sort(b + 1, b + n + 1);
    int m = unique(b + 1, b + n + 1) - (b + 1);
    if (m >= 4) {
      puts("No");
      continue;
    }
    for (int t = 1; t <= m; t++)
      for (int i = 1; i <= n; i++)
        if (b[t] == a[i]) cnt[t]++;
    sort(cnt + 1, cnt + m + 1);
    if (m == 1) puts("No");
    if (m == 2) {
      if (n % 3 == 0) {
        if (cnt[1] == n / 3 && cnt[2] == n / 3 * 2 && b[1] == 0)
          puts("Yes");
        else
          puts("No");
      } else
        puts("No");
    }
    if (m == 3) {
      if (n % 3 == 0) {
        if (cnt[1] == n / 3 && cnt[2] == n / 3 && cnt[3] == n / 3 &&
            (b[1] == (b[2] ^ b[3])))
          puts("Yes");
        else
          puts("No");
      } else
        puts("No");
    }
  }
  return 0;
}
