#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int flag = 0;
  int flag_zero = 0;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] != 0) {
      flag_zero = 1;
    }
  }
  if (n % 3 == 0) {
    vector<int> a(3, -1);
    vector<int> b(3, 0);
    int count = 0;
    for (int i = 0; i < n; i++) {
      int find = 0;
      for (int j = 0; j < count; j++) {
        if (v[i] == a[j]) {
          b[j]++;
          find = 1;
          break;
        }
      }
      if (find == 0) {
        if (count < 3) {
          a[count] = v[i];
          b[count]++;
          count++;
        } else {
          flag = 1;
          break;
        }
      }
    }
    if (count == 3) {
      if (a[0] ^ a[1] != a[2] || b[0] != b[1] || b[0] != b[2]) {
        flag = 1;
      }
    } else if (count == 2) {
      flag = 1;
      if (a[0] ^ a[0] == a[1] && b[0] == 2 * b[1]) {
        flag = 0;
      }
      if (a[1] ^ a[1] == a[0] && b[1] == 2 * b[0]) {
        flag = 0;
      }
    } else {
      flag = 1;
    }
  } else {
    flag = 1;
  }
  if (flag && flag_zero) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}
