#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (mp[0] == 0) {
    auto itr = mp.begin();
    long long val1 = next(itr)->first;
    long long val2 = next(itr, 2)->first;
    long long val3 = next(itr, 3)->first;
    if (mp.size() == 4 && (val1 ^ val2 ^ val3) == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else if (mp[0] != 0) {
    auto itr = mp.begin();
    long long cnt1 = itr->second;
    long long cnt2 = next(itr)->second;
    if (mp.size() == 2 && cnt1 * 2 == cnt2) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
}
