#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int a, b, c;
  int s0, s1;
  int ans = 0;
  cin >> N;
  cin >> a >> b;
  s0 = a;
  s1 = b;
  for (int i = 2; i < N; i++) {
    cin >> c;
    if ((a ^ c) != b) ans = 1;
    a = b;
    b = c;
  }
  if ((a ^ s0) != b) ans = 1;
  if ((b ^ s1) != s0) ans = 1;
  if (ans == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
