#include <bits/stdc++.h>
using lint = long long;
int main(int argc, char** argv) {
  lint n;
  std::cin >> n;
  int ans = 1;
  std::vector<lint> a(n);
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (0 == i) {
      if (a[0] != (a[1] ^ a[n - 1])) {
        ans = 0;
        break;
      }
    } else if ((n - 1) == i) {
      if (a[n - 1] != (a[n - 2] ^ a[0])) {
        ans = 0;
        break;
      }
    } else {
      if (a[i] != (a[i - 1] ^ a[i + 1])) {
        ans = 0;
        break;
      }
    }
  }
  std::puts(ans == 0 ? "No" : "Yes");
  return 0;
}
