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