#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  long long countzero = 0;
  vector<vector<long long> > vv;
  bool flg;
  for (int i = 0; i < N; i++) {
    vector<long long> a(2, 1);
    cin >> a[0];
    if (a[0] == 0) {
      countzero++;
    } else {
      flg = true;
      for (int j = 0; j < vv.size(); j++) {
        if (a[0] == vv[j][0]) {
          vv[j][1]++;
          flg = false;
        }
      }
      if (flg) {
        vv.push_back(a);
      }
      if (vv.size() > 3) {
        break;
      }
    }
  }
  bool ok = false;
  if (vv.size() == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (countzero > 0) {
    long long sum = 0;
    if (vv.size() == 1) {
      if (vv[0][1] == countzero * 2) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  } else {
    if (vv.size() == 3) {
      if (vv[0][1] == vv[1][1] && vv[1][1] == vv[2][1]) {
        ok = true;
      }
      if (vv[0][0] == (long long)(vv[1][0] ^ vv[2][0])) {
        ok = true;
      }
    }
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
