#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int INF = 2e9;
const double epsilon = 1e-7;
const double PI = 3.1415926535;
long long int a[100000];
long long int cou[5];
long long int b[5];
int main(void) {
  long long int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int c = 0;
  long long int mem = -1;
  int j = -1;
  fill(cou, cou + 5, 1);
  for (int i = 0; i < n; i++) {
    if (mem != a[i]) {
      c++;
      j++;
      mem = b[j] = a[i];
    } else
      cou[j]++;
    if (c > 3) {
      printf("No\n");
      return 0;
    }
  }
  if (c == 1) {
    if (a[0] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (c == 2) {
    if (a[0] == 0 && cou[0] == cou[1])
      printf("Yes\n");
    else
      printf("No\n");
  } else {
    if (cou[0] == cou[1] && cou[1] == cou[2]) {
      if (b[0] ^ b[1] == b[2])
        printf("Yes\n");
      else
        printf("No\n");
    } else
      printf("No\n");
  }
  return 0;
}
