#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 55;
signed main() {
  ll N;
  cin >> N;
  map<ll, ll> m;
  for (ll i = 0; i < N; i++) {
    ll a;
    cin >> a;
    m[a]++;
  }
  if (m.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<ll> vec;
  for (auto it = m.begin(); it != m.end(); it++) {
    vec.push_back(it->first);
  }
  if (m.size() == 3) {
    if (N % 3 == 0 && vec[0] ^ vec[1] == vec[2] && m[vec[0]] == m[vec[1]] &&
        m[vec[1]] == m[vec[2]]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (m.size() == 2) {
    ll x = vec[0];
    ll y = vec[1];
    if (m[y] > m[x]) swap(x, y);
    if (y != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (m[x] >= 2) {
      ll numx = 2;
      ll num0 = 0;
      ll first = x;
      ll second = x;
      ll next;
      for (ll i = 2; i < N; i++) {
        next = first ^ second;
        if (next == 0)
          num0++;
        else
          numx++;
        first = second;
        second = next;
      }
      if (second == first ^ x && m[x] == numx && m[y] == num0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    ll numx = 1;
    ll num0 = 1;
    ll first = x;
    ll second = 0;
    ll next;
    for (ll i = 2; i < N; i++) {
      next = first ^ second;
      if (next == 0)
        num0++;
      else
        numx++;
      first = second;
      second = next;
    }
    if (second == first ^ x && m[x] == numx && m[y] == num0) {
      cout << "Yes" << endl;
    } else {
      throw "hoge";
      cout << "No" << endl;
    }
  } else {
    if (vec[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
