#include <bits/stdc++.h>
using namespace std;
constexpr long long mod = 1000000007;
constexpr long long INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  if (n % 3 != 0) {
    cout << "No\n";
    return 0;
  }
  sort(a.begin(), a.end());
  vector<long long> num, ins_cnt;
  a.push_back(-1ll);
  long long cnt = 1;
  num.push_back(a[0]);
  for (long long i = 0; i < a.size() - 1; ++i) {
    if (a[i] == a[i + 1]) {
      cnt++;
    } else {
      ins_cnt.push_back(cnt);
      num.push_back(a[i + 1]);
      cnt = 1;
    }
  }
  if (!(ins_cnt[0] == ins_cnt[1] && ins_cnt[1] == ins_cnt[2])) {
    cout << "No\n";
    return 0;
  }
  if (!(num[0] == num[1] ^ num[2] || num[1] == num[0] ^ num[2] ||
        num[2] == num[0] ^ num[1])) {
    cout << "No\n";
  }
  cout << "Yes\n";
  return 0;
}
