#include <bits/stdc++.h>
using namespace std;
long double eps = 1.0E-14;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return gcd(a, b) * (a / gcd(a, b)) * (b / gcd(a, b));
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i];
  string ans = "Yes";
  for (long long i = 1; i <= (long long)(n - 2); i++) {
    long long c = a[i - 1] ^ a[i + 1];
    if (c != a[i]) ans = "No";
  }
  cout << ans << endl;
  return 0;
}
