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