#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, per, kind;
int a[N], cnt[N], num[N] = {-1};
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == a[i - 1])
      cnt[kind]++;
    else
      cnt[++kind] = 1, num[kind] = a[i];
  }
  if (kind > 3)
    printf("No\n");
  else if (kind == 3) {
    if (cnt[1] == cnt[2] && cnt[2] == cnt[3] && num[1] ^ num[2] ^ num[3] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (kind == 2) {
    if (num[1] == 0 && cnt[1] * 2 == cnt[2])
      printf("Yes\n");
    else
      printf("No\n");
  } else if (kind == 1) {
    if (num[1] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
