#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, a[maxn];
map<int, int> cnt;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]), cnt[a[i]]++;
  }
  sort(a + 1, a + n + 1);
  if (cnt.size() == 3 && cnt[a[1]] == n / 3 && cnt[a[3]] == n / 3 &&
      cnt[a[1] ^ a[3]] == n / 3) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
