#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const int MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  bool zzz = true;
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    if (a[i] != 0) {
      zzz = false;
    }
  }
  if (zzz) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n == 3) {
    for (int i = (1); i < (n - 1); i++) {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) {
        cout << "No" << endl;
        return 0;
      }
    }
    if ((a[n - 2] ^ a[0]) != a[n - 1]) {
      cout << "No" << endl;
      return 0;
    }
    if ((a[n - 1] ^ a[1]) != a[0]) {
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
  } else if (n % 3 == 0) {
    sort((a).begin(), (a).end());
    if ((a[0] == a[n / 3 - 1] && a[n / 3] == a[n * 2 / 3 - 1] &&
         a[n * 2 / 3] == a[n - 1]) &&
        (a[0] == 0 || a[n / 3] != a[n - 1])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
