#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e10;
const long long MOD = 1e9 + 7;
bool dbg = false;
long long N, a[100010];
vector<long long> v, c;
bool ans;
void solve() {
  for (long long i = (0); i < (N); ++i) {
    bool flag = true;
    for (long long j = (0); j < ((long long)v.size()); ++j) {
      if (a[i] == v[j]) {
        c[j]++;
        flag = false;
        break;
      }
    }
    if (flag) {
      v.push_back(a[i]);
      c.push_back(1);
      if ((long long)v.size() > 3) {
        ans = false;
        return;
      }
    }
  }
  long long n = (long long)v.size();
  if (n == 1) {
    if (v[0] == 0) {
      ans = true;
    } else {
      ans = false;
    }
  } else if (n == 2) {
    if ((v[0] == 0 && c[0] * 2 == c[1]) || (v[1] == 1 && c[1] * 2 == c[0])) {
      ans = true;
    } else {
      ans = false;
    }
  } else if (n == 3) {
    if (c[0] == c[1] && c[1] == c[2] && v[0] == v[1] ^ v[2] &&
        v[1] == v[0] ^ v[2]) {
      ans = true;
    } else {
      ans = false;
    }
  }
  return;
}
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> N;
  for (long long i = (0); i < (N); ++i) {
    cin >> a[i];
  }
  solve();
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
