#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, i, flag = 0;
  cin >> n;
  long long int a[n], b[n];
  for (i = 0; i < n; i++) cin >> a[i];
  b[0] = (a[n - 1] ^ a[1]);
  for (i = 1; i < (n - 1); i++) {
    b[i] = (a[i - 1] ^ a[i + 1]);
  }
  b[n - 1] = (a[0] ^ a[n - 2]);
  sort(a, a + n);
  sort(b, b + n);
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      flag = 1;
      break;
    }
  }
  if (flag == 0)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
