#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  long long a[100005];
  map<long long, long long> mp;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  vector<long long> b;
  for (auto&& i : mp) {
    if (b.size() == 3) {
      cout << "No" << endl;
      return 0;
    } else {
      b.push_back(i.first);
    }
  }
  if (N % 3 == 0) {
    if (b.size() == 2) {
      cout << "No" << endl;
      return 0;
    } else if (b.size() == 3) {
      if ((b[0] ^ b[1] ^ b[2]) == 0) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    } else if (b[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  } else {
    if (b.size() == 1 && b[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
