#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = (long long)1000000007 * 1000000007;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
int n;
vector<long long> a;
void solve() {
  cin >> n;
  a.resize(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  if (n % 3 != 0)
    puts(a[0] == a[n - 1] && a[0] == 0 ? "Yes" : "No");
  else
    puts(a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] &&
                 a[2 * n / 3] == a[n - 1] && a[0] ^ a[n / 3] ^ a[2 * n / 3] == 0
             ? "Yes"
             : "No");
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
