#include <bits/stdc++.h>
const int N = 1e5 + 5;
int n, a[N];
class AXORCircle {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int n;
    in >> n;
    for (int i = 0; i < n; ++i) {
      in >> a[i];
    }
    bool ok = 1;
    for (int i = 0; i < n; ++i) {
      ok &= (a[((i - 1) % n + n) % n] ^ a[(i + 1) % n]) == a[i];
    }
    out << (ok ? "Yes" : "No") << "\n";
  }
};
int main() {
  AXORCircle solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
