#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int main() {
  int n;
  cin >> n;
  bool ans;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  sort((a).begin(), (a).end());
  if (a[n - 1] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (a[0] == 0) {
    if (a[n / 3 - 1] == 0 && a[n / 3] == a[n - 1])
      ans = true;
    else
      ans = false;
  } else {
    if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] &&
        a[2 * n / 3] == a[n - 1] && a[0] != a[n / 3] &&
        a[n / 3] != a[2 * n / 3] && a[0] ^ a[n / 3] == a[2 * n / 3])
      ans = true;
    else
      ans = false;
  }
  string s = (ans) ? "Yes" : "No";
  cout << s << endl;
}
