#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  int a[3] = {};
  int m[3] = {};
  int p = 0;
  int b;
  for (int i = 0; i < n; i++) {
    cin >> b;
    int s;
    for (s = 0; s < p; s++) {
      if (a[s] == b) break;
    }
    if (s >= 3) {
      cout << "No" << endl;
      return 0;
    }
    if (s == p) {
      a[s] = b;
      p++;
    }
    m[s]++;
  }
  if (p == 1) {
    if (a[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (p == 2) {
    if (a[0] == 0 && m[1] == m[0] * 2) {
      cout << "Yes" << endl;
      return 0;
    }
    if (a[1] == 0 && m[0] == m[1] * 2) {
      cout << "Yes" << endl;
      return 0;
    }
  } else {
    if (m[0] == m[1] && m[1] && m[2])
      if (a[2] == (a[0] ^ a[1])) {
        cout << "Yes" << endl;
        return 0;
      }
  }
  cout << "No" << endl;
  return 0;
}
