#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 2e9;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int GCD(int x, int y) { return y ? GCD(y, x % y) : x; }
int LCM(int x, int y) { return x * y / GCD(x, y); }
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  string ans = "No";
  if (a[0] == 0 && a[n - 1] == 0) {
    ans = "Yes";
  } else if (n % 3 == 0) {
    if (a[0] == 0 && a[n / 3 - 1] == 0 && a[n / 3] == a[n - 1]) {
      ans = "Yes";
    } else if (a[0] ^ a[n / 3] ^ a[n * 2 / 3] == 0 && a[0] == a[n / 3 - 1] &&
               a[n / 3] == a[n * 2 / 3 - 1] && a[n * 2 / 3] == a[n - 1]) {
      ans = "Yes";
    }
  }
  cout << ans << endl;
}
