#include <bits/stdc++.h>
using namespace std;
int n;
int a[100001];
bool cmp(int a, int b) { return a > b; }
int main() {
  scanf("%d", &n);
  ;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  int flag = 0;
  for (int i = 1; i <= n - 2; i++)
    if (a[i] ^ a[i + 1] != a[i + 2]) {
      flag = 1;
      break;
    }
  if ((a[n - 1] ^ a[n]) != a[1]) {
    flag = 1;
  }
  int sign = 0;
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n - 2; i++)
    if (a[i] ^ a[i + 1] != a[i + 2]) {
      sign = 1;
      break;
    }
  if ((a[n - 1] ^ a[n]) != a[1]) {
    sign = 1;
  }
  if (flag && sign)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}
