#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T updmax(T &a, T b) {
  return a = max(a, b);
}
template <class T>
inline T updmin(T &a, T b) {
  return a = min(a, b);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n, 0);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a.begin(), a.end());
  if (n % 3 == 0) {
    for (int i = 0; i < 3; i++) {
      if (a[i] != a[i + n / 3 - 1]) {
        printf("No\n");
        return 0;
      }
    }
    if (a[0] ^ a[n / 3] == a[(n * 2) / 3])
      printf("Yes\n");
    else
      printf("No\n");
    return 0;
  } else {
    if (a[0] != a[n - 1])
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
