#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
map<int, int> mp;
int main(void) {
  scanf("%d", &n);
  bool flag0 = true;
  int zo = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != 0)
      flag0 = false;
    else {
      zo++;
    }
    mp[a[i]]++;
  }
  if (flag0) {
    printf("Yes\n");
    return 0;
  }
  if (n % 3 != 0) {
    printf("No\n");
    return 0;
  }
  if (zo == n * 2 && mp.size() == 2) {
    printf("Yes\n");
    return 0;
  }
  if (mp.size() != 3) {
    printf("No\n");
    return 0;
  }
  int sum = 0;
  bool ok = true;
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
    if (n / 3 != (*it).second) ok = false;
    sum ^= (*it).first;
  }
  if (sum != 0) ok = false;
  printf("%s\n", ok ? "Yes" : "No");
  return 0;
}
