#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 2e9;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> cnt(35, 0);
  bool flag = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) {
      flag = false;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  } else if (n == 3) {
    if (a[2] == a[1] ^ a[0]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  } else if (n % 3 != 0) {
    cout << "No" << endl;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 31; j++) {
      cnt[j] += a[i] % 2;
      a[i] /= 2;
    }
  }
  flag = true;
  for (int i = 0; i < 31; i++) {
    if (cnt[i] * 2 / 3) {
      flag = false;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
