#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
int main() {
  int n;
  cin >> n;
  int tem;
  bitset<100> bs1;
  bitset<100> bs2;
  bitset<100> bs3;
  bitset<100> fir;
  bitset<100> sec;
  bitset<100> temp;
  cin >> tem;
  bs1 = tem;
  cin >> tem;
  bs2 = tem;
  fir = bs1;
  sec = bs2;
  bool flag = 1;
  for (int64_t i = (0); i < (n - 2); i++) {
    cin >> tem;
    bs3 = tem;
    temp = bs1 ^ bs3;
    if (temp != bs2) {
      flag = 0;
      break;
    }
    bs1 = bs2;
    bs2 = bs3;
  }
  temp = bs1 ^ fir;
  if (temp != bs2) flag = 0;
  temp = bs2 ^ sec;
  if (temp != fir) flag = 0;
  if (flag)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
}
