#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int circle[N];
  for (int i = (0); (i) < (N); i++) cin >> circle[i];
  bool flag1 = false;
  bool flag2 = false;
  bool flag3 = false;
  int ans = 0;
  if ((circle[N - 1] ^ circle[1]) == circle[0]) flag1 = true;
  if ((circle[N - 2] ^ circle[0]) == circle[N - 1]) flag2 = true;
  for (int i = (1); (i) < (N - 1); i++) {
    if ((circle[i - 1] ^ circle[i + 1]) == circle[i]) ans++;
  }
  if (ans == N - 2) flag3 = true;
  if (flag1 && flag2 && flag3)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
