#include <bits/stdc++.h>
using namespace std;
const int MAXN = 8e4;
int a[MAXN + 5];
int n;
struct node {
  int cnt, num;
} t[MAXN + 5];
void Solve() {
  int cnt = 0;
  memset(t, 0, sizeof(t));
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == a[i - 1])
      t[cnt].cnt++;
    else
      t[++cnt].cnt = 1, t[cnt].num = a[i];
    if (cnt > 3) {
      printf("No\n");
      return;
    }
  }
  if (cnt == 3) {
    if (t[1].cnt == t[2].cnt == t[3].cnt &&
        (t[1].num ^ t[2].num ^ t[3].num) == 0)
      printf("Yes\n");
    else
      printf("No\n");
  }
  if (cnt == 2) {
    if (t[1].num == 0 && t[1].cnt * 2 == t[2].cnt)
      printf("Yes\n");
    else
      printf("No\n");
  }
  if (cnt == 1) {
    if (t[1].num == 0)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
int main() {
  int t;
  {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    Solve();
  }
  return 0;
}
