#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
const ll INF = 1LL << 60;
const ll MOD = (ll)1e9 + 7;
int main() {
  ll n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  bool flag = true;
  for (int i = 0; i < n - 2; i++) {
    if (v[i] ^ v[i + 1] ^ v[i + 2]) flag = false;
  }
  cout << (flag ? "Yes" : "No") << "\n";
}
