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