#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<ll>;
using vvll = vector<vll>;
bool solve(vi& a) {
  int n = a.size();
  map<int, int> m;
  vi x(3), y(3);
  for (int i = 0; i < n; i++) {
    m[a[i]]++;
  }
  if (m.size() != 3) {
    return (m[0] == n);
  }
  int i = 0;
  for (auto& mm : m) {
    x[i] = mm.first;
    y[i] = mm.second;
    i++;
  }
  if ((x[0] ^ x[1]) != x[2]) return false;
  if (y[0] != y[1] || y[1] != y[2]) return false;
  return true;
}
int main(void) {
  int n;
  while (scanf("%d", &n) == 1) {
    vi a(n);
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    bool ans = solve(a);
    printf("%s\n", ans ? "Yes" : "No");
  }
  return 0;
}
