#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, o = 0, i, j, k;
  int sum = 0, range = 0;
  int *num = new int[5];
  cin >> n;
  cin >> num[0] >> num[1];
  num[2] = num[0];
  num[3] = num[1];
  for (i = 3; i <= n; i++) {
    cin >> num[4];
    if ((num[2] ^ num[4]) != num[3]) {
      cout << "No";
      return 0;
    }
    if (i == n) break;
    num[2] = num[3];
    num[3] = num[4];
  }
  if ((num[1] ^ num[4]) != num[0] || (num[0] ^ num[3]) != num[4])
    cout << "No";
  else
    cout << "Yes";
  delete[] num;
  return 0;
}
