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