#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
signed main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (long long i = 0, i_len = (N); i < i_len; ++i) cin >> a[i];
  bool ans;
  if (N == 3) {
    if ((a[0] == a[1] ^ a[2]) && (a[1] == a[2] ^ a[0]) && (a[2] == a[0] ^ a[1]))
      ans = true;
    else
      ans = false;
  } else if (N >= 7) {
    ans = true;
    for (long long i = 1; i < N; i++)
      if (a[0] != a[i]) ans = false;
  } else {
    assert(false);
    sort(a.begin(), a.end());
    do {
      ans = true;
      for (long long i = 0, i_len = (N); i < i_len; ++i) {
        if (a[i] != (a[(i - 1 + N) % N] ^ a[(i + 1) % N])) {
          ans = false;
          break;
        }
      }
      if (ans) break;
    } while (next_permutation(a.begin(), a.end()));
  }
  if (ans)
    puts("Yes\n");
  else
    puts("No\n");
  return 0;
}
