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