#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  bool a0 = true;
  int vals[3];
  int cnt[3];
  int distinct = 0;
  for (int i = 0; i < N; i++) {
    int x;
    scanf("%d", &x);
    if (x != 0) a0 = false;
    for (int j = 0; j < distinct; j++) {
      if (vals[j] == x) {
        cnt[j]++;
      }
    }
    if (distinct == 3) {
      printf("No");
      return 0;
    }
    vals[distinct] = x;
    cnt[distinct] = 1;
    distinct++;
  }
  if (a0) {
    printf("Yes");
    return 0;
  }
  if (distinct == 1) {
    printf("No");
    return 0;
  }
  if (distinct == 2) {
    if (vals[0] == 0 && cnt[0] * 2 == cnt[1]) {
      printf("Yes");
      return 0;
    } else if (vals[1] == 0 && cnt[1] * 2 == cnt[0]) {
      printf("Yes");
      return 0;
    } else {
      printf("No");
      return 0;
    }
  }
  if (distinct == 3) {
    if (vals[0] ^ vals[1] != vals[2]) {
      printf("No");
      return 0;
    }
    if (cnt[0] == cnt[1] && cnt[1] == cnt[2]) {
      printf("Yes");
      return 0;
    }
    printf("No");
    return 0;
  }
}
