#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;
  bool can = true;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  long long num = a[0], key1, key2 = -1;
  for (long long i = 0; i < n; ++i) {
    if (i == 0) continue;
    key1 = a[i];
    vector<long long int>::iterator position;
    position = lower_bound(a.begin(), a.end(), num ^ key1);
    long long key = distance(a.begin(), position);
    if (position != a.end()) {
      if (a[key] == num ^ key1) {
        key2 = a[key];
        break;
      }
    } else {
      can = false;
    }
  }
  for (long long i = 0; i < n; ++i) {
    if (!(a[i] == num || a[i] == key1 || a[i] == key2)) {
      can = false;
    }
  }
  sort(a.begin(), a.end());
  long long cnt_num = 0, cnt_key1 = 0, cnt_key2 = 0;
  for (long long i = 0; i < n; ++i) {
    if (a[i] == num)
      cnt_num++;
    else if (a[i] == key1)
      cnt_key1++;
    else if (a[i] == key2)
      cnt_key2++;
  }
  if (!(cnt_num == cnt_key1 && cnt_num == cnt_key2)) can = false;
  if (can)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
