#include <bits/stdc++.h>
using namespace std;
const long long N = 200111;
long long n;
long long t[N];
map<long long, long long> mp;
set<long long> st;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> t[i];
    mp[t[i]]++;
    st.insert(t[i]);
  }
  if (st.size() == 3) {
    vector<long long> a;
    vector<long long> b;
    for (auto it = st.begin(); it != st.end(); it++) {
      a.push_back(*it);
      b.push_back(mp[*it]);
    }
    if (b[0] == b[1] && b[1] == b[2]) {
      if (a[0] ^ a[1] == a[2]) {
        cout << "Yes"
             << "\n";
        return 0;
      } else {
        cout << "No"
             << "\n";
        return 0;
      }
    } else {
      cout << "No"
           << "\n";
      return 0;
    }
  } else if (st.size() == 2) {
    vector<long long> a;
    vector<long long> b;
    for (auto it = st.begin(); it != st.end(); it++) {
      a.push_back(*it);
      b.push_back(mp[*it]);
    }
    if (a[0] == 0 && b[0] * 2 == b[1]) {
      cout << "Yes"
           << "\n";
      return 0;
    } else if (a[1] == 0 && b[1] * 2 == b[0]) {
      cout << "Yes"
           << "\n";
      return 0;
    } else {
      cout << "No"
           << "\n";
      return 0;
    }
  } else if (st.size() == 1) {
    if (t[1] == 0) {
      cout << "Yes"
           << "\n";
      return 0;
    } else {
      cout << "No"
           << "\n";
      return 0;
    }
  } else {
    cout << "No"
         << "\n";
    return 0;
  }
  return 0;
}
