#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  set<long long> se;
  map<long long, long long> ma;
  vector<long long> arr;
  int prev = 0;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    ma[temp]++;
    se.insert(temp);
    if (se.size() != prev) {
      arr.push_back(temp);
      prev = se.size();
    }
  }
  sort(arr.begin(), arr.end());
  if (n % 3 == 0) {
    if (se.size() == 3) {
      int temp = arr[0] ^ arr[1];
      if (temp == arr[2]) {
        cout << "Yes" << endl;
        return 0;
      }
    } else if (se.size() == 2) {
      if (arr[0] == 0) {
        if (ma[arr[1]] == (2 * ma[0])) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    } else if (se.size() == 1)
      if (arr[0] == 0) {
        cout << "Yes" << endl;
        return 0;
      }
  } else {
    if (se.size() == 1) {
      if (arr[0] == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
