#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    int curr;
    cin >> curr;
    mp[curr]++;
  }
  if (mp.size() == 1 && mp[0] > 0) {
    cout << "Yes" << endl;
  } else if (mp.size() == 3 && n % 3 == 0) {
    vector<int> arr;
    bool f = true;
    for (auto i : mp) {
      if (i.second != n / 3) {
        f = false;
      }
      arr.push_back(i.first);
    }
    if (arr[0] ^ arr[2] != arr[1] && arr[0] ^ arr[1] != arr[2]) {
      f = false;
    }
    if (f) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
