#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr ll mod = static_cast<ll>(1e9 + 7);
template <long long Mod = mod>
constexpr long long MOD(long long in) {
  return in % Mod;
}
template <class T>
constexpr T UP(T left, T div) {
  return (left + div - 1) / div;
}
int n;
ll a[100005];
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::cin >> n;
  for (int i = 0; i < n; i++) std::cin >> a[i];
  for (int i = n; i < 2 * n; i++) a[i] = a[i - n];
  if (n == 3) {
    bool ok = true;
    for (int i = 0; i < n; i++)
      if (a[i + 1] != (a[i] ^ a[i + 2])) ok = false;
    if (ok)
      std::cout << "Yes" << std::endl;
    else
      std::cout << "No" << std::endl;
  } else {
    std::map<ll, int> m;
    for (int i = 0; i < n; i++) m[a[i]]++;
    if (m.size() == 1 && m.count(0) != 0 ||
            n % 2 == 1 && m.size() == 2 && m.count(0) != 0 && m[0] == n / 2 ||
            n % 2 == 0 && [&m]() -> bool {
          if (m.size() != 2) return false;
          ll temp[2]{};
          int num = 0;
          for (auto& mm : m) {
            temp[num] = mm.second;
            num++;
          }
          if (temp[0] == n / 2 || temp[1] == n / 2) return true;
          return false;
        }())
      std::cout << "Yes" << std::endl;
    else
      std::cout << "No" << std::endl;
  }
  return 0;
}
