#include <bits/stdc++.h>
using namespace std;
long long a[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  a[n + 1] = a[1];
  a[0] = a[n];
  bool ans = true;
  for (int i = 1; i <= n; i++)
    if ((a[i - 1] ^ a[i + 1]) != a[i]) ans = false;
  if (ans == true)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
