#include <bits/stdc++.h>
using namespace std;
void masterstroke() {
  long long n, m;
  cin >> n;
  long long a[n];
  set<long long> x;
  map<long long, long long> c;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    x.insert(a[i]);
    c[a[i]]++;
  }
  long long z = x.size();
  if (z > 3ll || z == 1ll || n % 3 != 0)
    cout << "No";
  else {
    long long as[3];
    long long r = 0;
    for (auto j : x) {
      as[r++] = j;
    }
    if (z == 2ll) {
      if ((as[0] == 0ll || as[1] == 0ll) && c[0] == n / 3)
        cout << "Yes";
      else {
        cout << "No";
      }
      return;
    }
    for (auto j : x) {
      if (c[j] != n / 3) {
        cout << "No";
        return;
      }
    }
    if (as[0] ^ as[2] == as[1] || as[0] ^ as[1] == as[2] ||
        as[2] ^ as[1] == as[0])
      cout << "Yes";
    else
      cout << "No";
  }
}
int main() {
  long long t = 1;
  for (long long i = 0; i < t; i++) masterstroke();
}
