#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ld = long double;
using ll = long long;
ll gcd(ll m, ll n) {
  if (n == 0) return abs(m);
  return (gcd(n, m % n));
}
void putYN(bool b) {
  if (b) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
void swap(ll &a, ll &b) {
  ll tmp = a;
  a = b;
  b = tmp;
}
ll combi(ll n, ll k) {
  ll r = 1, rr = 1;
  for (ll i = 0; i < k; ++i) {
    r *= (n - i);
    rr *= (i + 1);
  }
  r /= rr;
  return r;
}
int main() {
  ll N;
  cin >> N;
  map<ll, ll> a;
  bool flag = true;
  for (ll i = 0; i < N; ++i) {
    ll tmp;
    cin >> tmp;
    if (a.find(tmp) == a.end()) {
      a[tmp] = 1;
    } else {
      a[tmp]++;
    }
    if (a.size() > 3) {
      flag = false;
      break;
    }
  }
  if (flag) {
    if (a.size() == 3) {
      auto i0 = a.begin();
      auto i1 = i0;
      auto i2 = i0;
      i1++;
      i2++;
      i2++;
      if ((ll)(i1->first ^ i2->first) != i0->first) {
        flag = false;
      }
      if ((i0->second == i1->second && i2->second + 1) ||
          (i1->second == i2->second && i0->second + 1) ||
          (i2->second == i0->second && i1->second + 1)) {
      } else {
        flag = false;
      }
    } else if (a.size() == 2) {
      auto i0 = a.begin();
      auto i1 = i0;
      i1++;
      if (i0->first == 0 || i1->first == 0) {
      } else {
        flag = false;
      }
      if (i0->second != i1->second) {
        flag = false;
      }
    } else {
      if (a.begin()->first != 0) {
        flag = false;
      }
    }
  }
  if (!flag) {
  }
  putYN(flag);
  return 0;
}
