#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, x[N];
map<int, int> Cnt;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", x + i);
    Cnt[x[i]] += 1;
  }
  for (int i = 2; i <= n; ++i) {
    int OK = 0, a, b, c;
    a = x[1];
    b = x[i];
    c = a ^ b;
    if (Cnt[c] == 0) continue;
    if (a == c) swap(b, c);
    if (a == b)
      OK = (Cnt[a] == Cnt[c] * 2 || Cnt[a] == Cnt[c] * 2 + 1) &&
           Cnt[a] + Cnt[c] == n;
    else
      OK =
          Cnt[a] == Cnt[b] && Cnt[a] == Cnt[c] && Cnt[a] + Cnt[b] + Cnt[c] == n;
    if (OK) {
      puts("Yes");
      return 0;
    };
  }
  puts("No");
}
