#include <bits/stdc++.h>
int main() {
  int n;
  int a[3], a_cnt[3], cnt = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a_tmp;
    scanf("%d", &a_tmp);
    int j = 0;
    for (; j < cnt; j++) {
      if (a[j] == a_tmp) {
        a_cnt[j]++;
        continue;
      }
    }
    if (j == cnt) {
      if (cnt == 3) {
        printf("No\n");
        return 0;
      } else {
        a[j] = a_tmp;
        a_cnt[j] = 1;
        cnt++;
      }
    }
  }
  if (cnt == 1) {
    if (a[0] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (cnt == 2) {
    if (a_cnt[1] * 2 == a_cnt[0] && a[0] == 0 ||
        a_cnt[0] * 2 == a_cnt[1] && a[1] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else {
    if (a_cnt[0] == a_cnt[1] && a_cnt[1] == a_cnt[2] && a[0] ^ a[1] ^ a[2] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
