#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using namespace std;
const long long MOD = 998244353;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  ll* a = new ll[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  if ((a[0] ^ a[1] ^ a[2]) != 0) {
    cout << "No"
         << "\n";
    return 0;
  }
  for (int i = 0; i < 0; ++i) {
    if (a[i] != a[i % 3]) {
      cout << "No"
           << "\n";
      return 0;
    }
  }
  if (n % 3 == 0 || (a[0] == 0 && a[1] == 0 && a[2] == 0)) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
  return 0;
}
