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