#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N;
  cin >> N;
  ll a = -1, b = -1, c = -1;
  map<ll, ll> mp;
  for (int i = 0; i < N; ++i) {
    ll x;
    cin >> x;
    mp[x]++;
    if (mp[x] > 1) continue;
    if (a == -1)
      a = x;
    else if (b == -1)
      b = x;
    else if (c == -1)
      c = x;
  }
  if (a == 0 || b == 0 || c == 0) {
    if (b == 0) swap(a, b);
    if (mp[a] * 2 == mp[b]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  bool f;
  if (mp.size() != 3) {
    f = false;
  } else {
    if (mp[a] != mp[b] || mp[b] != mp[c])
      f = false;
    else {
      if (a ^ b != c)
        f = false;
      else
        f = true;
    }
  }
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
