#include <bits/stdc++.h>
const int maxn = 1e5 + 50;
const int maxm = maxn << 1;
;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
using namespace std;
long long n, a[100005];
long long id[100005];
long long ent[100005];
map<long long, int> mp;
int main() {
  scanf("%lld", &n);
  int f0 = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (a[i]) f0 = 1;
  }
  if (!f0) {
    printf("Yes\n");
    return 0;
  }
  int tot = 0;
  for (int i = 1; i <= n; i++) {
    if (!mp[a[i]]) {
      mp[a[i]] = ++tot;
      id[tot] = a[i];
    }
    ent[mp[a[i]]]++;
  }
  if (tot > 3 || n % 3 != 0) {
    printf("No\n");
    return 0;
  }
  if (tot == 3) {
    if ((id[1] ^ id[2] ^ id[3]) == 0 && ent[1] == n / 3 && ent[2] == n / 3 &&
        ent[3] == n / 3) {
      printf("Yes\n");
      return 0;
    }
  }
  if (tot == 2) {
    int po = 0;
    if (id[1] < id[2])
      po = 1;
    else
      po = 2;
    if (id[po] == 0 && ((po == 1 && ent[1] == n / 3 && ent[2] == n * 2 / 3) ||
                        (po == 2 && ent[2] == n / 2 && ent[1] == n * 2 / 3))) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}
