#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool B;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < (n + 1); ++i) {
    cin >> i;
    v.push_back(i);
    ;
  }
  for (int i = 0; i < n; i++)
    if (v[i - 1] ^ v[i + 1] == v[i]) {
      B = true;
    } else {
      B = false;
    }
  if (B) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
