#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
using pii = pair<long long, long long>;
template <typename T>
using prior = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using Prior = priority_queue<T>;
const long long INF = 1E18;
const long long mod = 1E9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (auto &x : v) cin >> x;
  sort((v).begin(), (v).end());
  if (n % 3 == 0) {
    if ((v[0] ^ v[n / 3]) != v[2 * n / 3]) return cout << "No\n", 0;
    for (long long i = 1; i < n / 3; ++i)
      if (v[i] != v[i - 1]) return cout << "No\n", 0;
    for (long long i = n / 3 + 1; i < 2 * n / 3; ++i)
      if (v[i] != v[i - 1]) return cout << "No\n", 0;
    for (long long i = 2 * n / 3 + 1; i < n; ++i)
      if (v[i] != v[i - 1]) return cout << "No\n", 0;
    return cout << "Yes\n", 0;
  } else
    for (auto x : v)
      if (x) return cout << "No\n", 0;
  return 0;
}
