#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool comp(const pair<ll, ll> &a, const pair<ll, ll> &b) {
  return a.first < b.first;
}
ll gcd(ll a, ll b) {
  ll tmp, r;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int factorial(int k);
ll nCr(ll n, ll r);
int permutation(int n, int r);
int main() {
  ll a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
  ll x[200004] = {};
  ll y[200004] = {};
  ll z[2003][2003] = {{}};
  vector<tuple<ll, ll>> vec;
  string s;
  string t;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> x[i];
  }
  if (a % 3 != 0) {
    for (int i = 0; i < a; i++) {
      if (x[i] != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else {
    sort(x, x + a);
    for (int i = 0; i < a; i++) {
      if (x[i] != 0) {
        ans = 1;
      }
    }
    if (ans == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    b = x[0];
    c = 0;
    for (int i = 0; i < a; i++) {
      if (b != x[i]) {
        if (!(c == a / 3 || c == a * 2 / 3)) {
          cout << "No" << endl;
          return 0;
        }
        b = x[i];
        c = 1;
        d++;
      } else {
        c++;
      }
    }
    if (!(d == 1 || d == 2)) {
      cout << d << endl;
      cout << "No" << endl;
      return 0;
    }
    if (x[0] ^ x[a / 3] == x[a - 1] && x[a / 3] ^ x[a - 1] == x[0] &&
        x[0] ^ x[a - 1] == x[a / 3]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
int permutation(int n, int r) {
  int n_sum, r_sum;
  int i;
  r = n - r;
  n_sum = factorial(n);
  r_sum = factorial(r);
  return n_sum / r_sum;
}
ll nCr(ll n, ll r) {
  ll ans = 1;
  for (ll i = n; i > n - r; --i) {
    ans = ans * i;
  }
  for (ll i = 1; i < r + 1; ++i) {
    ans = ans / i;
  }
  return ans;
}
int factorial(int k) {
  int sum = 1;
  for (int i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
