#include <bits/stdc++.h>
using namespace std;
long long MOD = (long long)1000000000 + 7;
const long long INF = 1e17;
const long double pi = acos(-1);
const long double EPS = 1e-10;
const long long MAX = 200020;
map<long long, long long> mp;
set<long long> st;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  for (long long i = 0; i < N; i++) {
    long long x;
    cin >> x;
    st.insert(x);
    mp[x]++;
  }
  if (st.size() == 1) {
    auto itr = st.begin();
    if (*itr == 0)
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
    ;
  } else if (st.size() == 2) {
    auto itr = st.begin();
    if (*itr == 0) {
      long long cnt = mp[0];
      for (auto x : mp) {
        if (x.first == 0) continue;
        if (x.second != cnt * 2) {
          cout << "No" << '\n';
          ;
          return 0;
        }
      }
      cout << "Yes" << '\n';
      ;
    } else
      cout << "No" << '\n';
    ;
  } else if (st.size() == 3) {
    long long a[3];
    long long c = 0;
    for (auto x : st) {
      a[c] = x;
    }
    bool ok = false;
    if (a[0] ^ a[2] == a[1] && a[1] ^ a[2] == a[0]) {
      ok = true;
    }
    if (!ok) {
      cout << "No" << '\n';
      ;
      return 0;
    }
    auto itr = st.begin();
    long long cnt = mp[*itr];
    for (auto x : mp) {
      if (x.second != cnt) {
        cout << "No" << '\n';
        ;
        return 0;
      }
    }
    cout << "Yes" << '\n';
    ;
  } else {
    cout << "No" << '\n';
    ;
  }
}
