#include <bits/stdc++.h>
using namespace std;
map<int, int> dp;
map<int, int>::iterator its;
int main() {
  int n, a;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    dp[a]++;
  }
  if (n % 3 != 0) {
    printf("No\n");
    return 0;
  }
  int mx = 0, mn = 1e9;
  vector<int> v;
  for (its = dp.begin(); its != dp.end(); its++) {
    v.push_back(its->first);
    mx = max(mx, its->second);
    mn = min(mn, its->second);
  }
  if (v.size() == 1) {
    if (v[0] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (v.size() == 2) {
    if (mn * 2 != mx)
      printf("No\n");
    else {
      if ((v[0] ^ v[0]) == v[1])
        printf("Yes\n");
      else if ((v[1] ^ v[1]) == v[0])
        printf("Yes\n");
      else
        printf("No\n");
    }
  } else if (v.size() == 3) {
    if ((v[0] ^ v[1]) != v[2] || n / 3 != mx) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  } else {
    printf("No\n");
  }
}
