#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
int N, a[112345];
int main() {
  scanf("%d", &N);
  for (long long i = 0; i < (N); ++i) scanf("%d", &a[i]);
  map<int, int> m;
  for (long long i = 0; i < (N); ++i) m[a[i]]++;
  if (m.size() > 3) {
    printf("No\n");
    return 0;
  }
  if (m.size() == 1) {
    if (m[0]) {
      printf("Yes\n");
      return 0;
    }
    printf("No\n");
    return 0;
  }
  if (m.size() == 2) {
    if (N % 2 || !m[0]) {
      printf("No\n");
      return 0;
    }
    int n;
    for (auto mm : m) {
      n = mm.first;
    }
    if (m[0] == m[n]) {
      printf("Yes\n");
      return 0;
    }
    printf("No\n");
    return 0;
  }
  if (N % 3) {
    printf("No\n");
    return 0;
  }
  vector<int> v;
  for (auto mm : m) {
    v.push_back(mm.first);
  }
  if ((v[0] ^ v[1]) == v[2]) {
    if (m[v[0]] == m[v[1]] && m[v[1]] == m[v[2]]) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}
