#include <bits/stdc++.h>
using namespace std;
int n, sum;
int a[100000 + 5];
int main() {
  scanf("%d", &n);
  if (n % 3 != 0) {
    printf("No\n");
  } else {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    int p = n / 3, F1 = 0, F2 = 0, F3 = 0;
    for (int i = 2; i <= p; i++)
      if (a[i] != a[i - 1]) F1 = 1;
    for (int i = p + 2; i <= p * 2; i++)
      if (a[i] != a[i - 1]) F2 = 1;
    for (int i = p * 2 + 2; i <= p * 3; i++)
      if (a[i] != a[i - 1]) F3 = 1;
    if (F1 || F2 || F3)
      printf("No\n");
    else {
      if (a[p] ^ a[p * 2] == a[p * 3])
        printf("Yes\n");
      else if (a[p * 2] ^ a[p * 3] == a[p])
        printf("Yes\n");
      else if (a[p] ^ a[p * 3] == a[p * 2])
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
}
