#include <bits/stdc++.h>
using namespace std;
int n, arr[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i <= n; i++) {
    if (i > 1 && i < n) {
      if ((arr[i - 1] ^ arr[i + 1]) != arr[i]) {
        cout << "No" << endl;
        return 0;
      }
    } else {
      if (i == 1) {
        if ((arr[n] ^ arr[i + 1]) != arr[i]) {
          cout << "No" << endl;
          return 0;
        }
      } else {
        if ((arr[i - 1] ^ arr[1]) != arr[i]) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
