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