#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  unsigned int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];
  bool allzero = true;
  for (int i = 0; i < N; i++) {
    if (a[i] != 0) {
      allzero = false;
      break;
    }
    if (allzero) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (N % 3) {
    cout << "No" << endl;
    return 0;
  }
  {
    bool yes = true;
    int numzero = 0;
    int numv = 0;
    int v = 0;
    for (int i = 0; i < N; i++) {
      if (a[i] == 0) {
        numzero++;
      } else {
        if (numv == 0) v = a[i];
        if (v == a[i]) {
          numv++;
        } else {
          yes = false;
          break;
        }
      }
    }
    if (yes) {
      if ((numzero == N / 3) && (numv == N / 3 * 2)) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  {
    int x = -1;
    int y = -1;
    int z = -1;
    int cx = 0;
    int cy = 0;
    int cz = 0;
    bool not3 = false;
    for (int i = 0; i < N; i++) {
      if (x == -1) {
        x = a[i];
      } else {
        if (y == -1) {
          if (x != a[i]) y = a[i];
        }
        if (z == -1) {
          if (x != a[i] && y != a[i]) z = a[i];
        } else {
          if (x != a[i] && y != a[i] && z != a[i]) {
            not3 = true;
            break;
          }
        }
      }
    }
    if (not3) {
    } else {
      if ((x ^ y ^ z) == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
