#include <bits/stdc++.h>
using namespace std;
int n;
long long a[100010];
std::map<long long, int> countMap;
long long ans[100010];
int zeroCount = 0;
int main() {
  zeroCount = 0;
  scanf("%d", &n);
  int maxCount = -1;
  long long maxNum;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &(a[i]));
    countMap[a[i]]++;
    if (a[i] == 0) {
      zeroCount++;
    }
    if (countMap[a[i]] > maxCount) {
      maxCount = countMap[a[i]];
      maxNum = a[i];
    }
  }
  if (n % 2 == 1) {
    if (zeroCount >= (n / 2 + 1)) {
      printf("Yes\n");
      return 0;
    }
  } else {
    if (zeroCount >= (n / 2 + 1)) {
      printf("Yes\n");
      return 0;
    }
  }
  ans[0] = maxNum;
  std::map<long long, int>::iterator iCountMap;
  for (iCountMap = countMap.begin(); iCountMap != countMap.end(); iCountMap++) {
    ans[1] = iCountMap->first;
    ans[2] = ans[0] ^ ans[1];
    if (ans[1] == 0 || ans[2] == 0) {
      int countA = countMap[ans[0]] / 2;
      int countB = countMap[0];
      int count;
      if (countA > countB)
        count = countB;
      else
        count = countA;
      int d = countMap[ans[0]] - count * 2;
      int newZeroCount = countMap[0] - count;
      if (d == newZeroCount) {
        printf("Yes\n");
        return 0;
      } else
        continue;
    } else {
      int countA = countMap[ans[0]];
      int countB = countMap[ans[1]];
      int countC = countMap[ans[2]];
      int count = countA;
      if (count > countB) count = countB;
      if (count > countC) count = countC;
      int d1 = countA - count;
      int d2 = countB - count;
      int d3 = countC - count;
      int d = d1 + d2 + d3;
      int newZeroCount = countMap[0];
      int newZ;
      if (d == d1) {
        newZ = d1;
      } else if (d == d2) {
        newZ = d2;
      } else if (d == d3) {
        newZ = d3;
      } else {
        continue;
      }
      int newNoZeroCount = n - count * 3 - countMap[0];
      if (newZ == newZeroCount) {
        printf("Yes\n");
        return 0;
      } else
        continue;
    }
  }
  printf("No\n");
  return 0;
}
