#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e+9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) cin >> a.at(i);
  if (n % 3 == 0) {
    bool flag = true;
    for (int i = 0; i < n - 2; i++)
      if ((a.at(i) ^ a.at(i + 1) ^ a.at(i + 2)) != 0) flag = false;
    if (flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (a.at(n - 1) == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
