#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  long long a[N];
  for (long long i = 0; i < (long long)(N); i++) cin >> a[i];
  string out = "Yes";
  for (long long i = 0; i < (long long)(N); i++) {
    if (i == 0) {
      if ((a[N - 1] ^ a[1]) != a[0]) {
        out = "No";
        break;
      }
    } else if (i == N - 1) {
      if ((a[N - 2] ^ a[0]) != a[N - 1]) {
        out = "No";
        break;
      }
    } else {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) {
        out = "No";
        break;
      }
    }
  }
  cout << out << endl;
  return 0;
}
