#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool pos = true;
  if (n % 2) {
    if (n == 3) {
      if (a[0] ^ a[1] != a[2]) pos = false;
    }
    if (n == 9) {
      sort(a, a + n);
      bool t = false;
      do {
        bool ok = true;
        for (int i = 0; i < n - 2; i++) {
          if (a[i] != (a[i + 1] ^ a[i + 2])) ok = false;
        }
        if (a[0] != (a[7] ^ a[8])) ok = false;
        if (a[0] != (a[8] ^ a[1])) ok = false;
        if (ok) {
          t = true;
          break;
        }
      } while (next_permutation(a, a + n));
      if (!t) pos = false;
    } else {
      bool zero = true;
      for (int i = 0; i < n; i++) {
        if (a[i] != 0) zero = false;
      }
      if (!zero) pos = false;
    }
  } else {
    if (n != 6) {
      bool zero = true;
      for (int i = 0; i < n; i++) {
        if (a[i] != 0) zero = false;
      }
      if (!zero) pos = false;
    } else if (n == 6) {
      sort(a, a + n);
      bool t = false;
      do {
        bool ok = true;
        for (int i = 0; i < n - 2; i++) {
          if (a[i] != (a[i + 1] ^ a[i + 2])) ok = false;
        }
        if (a[0] != (a[4] ^ a[5])) ok = false;
        if (a[0] != (a[5] ^ a[1])) ok = false;
        if (ok) {
          t = true;
          break;
        }
      } while (next_permutation(a, a + n));
      if (!t) pos = false;
    }
  }
  if (pos) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
