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