#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  if (n % 3 == 0) {
    if ((v[0] ^ v[n / 3] ^ v[n / 3 * 2]) == 0) {
      if (v[0] == v[n / 3 - 1] && v[n / 3] == v[n / 3 * 2 - 1] &&
          v[n / 3 * 2] == v[n - 1]) {
        cout << "Yes" << '\n';
        return 0;
      }
    }
  }
  cout << "No" << '\n';
}
