#include <bits/stdc++.h>
using namespace std;
const int LEN = 100000;
struct fastio {
  char s[LEN + 5];
  int len, it;
  fastio() { it = len = 0; }
  char get() {
    if (it < len) return s[it++];
    it = 0, len = fread(s, 1, LEN, stdin);
    return len ? s[it++] : EOF;
  }
  bool notend() {
    char c;
    for (c = get(); c == ' ' || c == '\n'; c = get())
      ;
    if (it) it--;
    return c != EOF;
  }
  void put(char c) {
    if (len == LEN) fwrite(s, 1, LEN, stdout), len = 0;
    s[len++] = c;
  }
  void flush() {
    fwrite(s, 1, len, stdout);
    len = 0;
  }
} buff, bufo;
inline long long getll() {
  char c;
  long long res = 0, sig = 1;
  for (c = buff.get(); c < '0' || c > '9'; c = buff.get())
    if (c == '-') sig = -1;
  for (; c >= '0' && c <= '9'; c = buff.get())
    res = (res << 3) + (res << 1) + (c - '0');
  return sig * res;
}
inline int getint() {
  char c;
  int res = 0, sig = 1;
  for (c = buff.get(); c < '0' || c > '9'; c = buff.get())
    if (c == '-') sig = -1;
  for (; c >= '0' && c <= '9'; c = buff.get())
    res = (res << 3) + (res << 1) + (c - '0');
  return sig * res;
}
inline void putll(long long x) {
  if (!x)
    bufo.put('0');
  else if (x < 0)
    bufo.put('-'), x = -x;
  char s[25];
  int k = 0;
  while (x) {
    s[++k] = x % 10 + '0';
    x /= 10;
  }
  for (int i = k; i >= 1; i--) bufo.put(s[i]);
}
inline void putint(int x) {
  if (!x)
    bufo.put('0');
  else if (x < 0)
    bufo.put('-'), x = -x;
  char s[15];
  int k = 0;
  while (x) {
    s[++k] = x % 10 + '0';
    x /= 10;
  }
  for (int i = k; i >= 1; i--) bufo.put(s[i]);
}
int n, a[100005], b[100005];
vector<int> as;
map<int, int> cnt;
int main() {
  n = getint();
  for (int i = 0; i < n; i++) {
    a[i] = getint();
    as.push_back(a[i]);
    cnt[a[i]]++;
  }
  sort(as.begin(), as.end());
  as.erase(unique(as.begin(), as.end()), as.end());
  if (as.size() > 3) {
    puts("No");
    return 0;
  }
  if (as.size() == 1) {
    if (a[0] == 0)
      puts("Yes");
    else
      puts("No");
    return 0;
  }
  b[0] = a[0];
  cnt[b[0]]--;
  for (int i = 0; i < (int)as.size(); i++) {
    bool okk = true;
    b[1] = as[i];
    cnt[b[1]]--;
    for (int i = 2; i < n; i++) {
      b[i] = b[i - 1] ^ b[i - 2];
      if (cnt.find(b[i]) == cnt.end()) {
        okk = false;
        break;
      }
      cnt[b[i]]--;
    }
    if (okk && b[0] == (b[n - 1] ^ b[n - 2]) && b[1] == (b[0] ^ b[n - 1])) {
      puts("Yes");
      return 0;
    }
    cnt.clear();
    for (int i = 1; i < n; i++) cnt[a[i]]++;
  }
  puts("No");
  return 0;
}
