#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  int first = a[0];
  int firstcount = 1;
  int second = -1;
  int secondcount = 0;
  int third = -1;
  int thirdcount = 0;
  for (int i = 1; i < n; ++i) {
    if ((second == -1) && (a[i] != first)) {
      second = a[i];
      secondcount++;
      continue;
    }
    if ((third == -1) && (a[i] != first) && (a[i] != second)) {
      third = a[i];
      thirdcount++;
      continue;
    }
    if (a[i] == first) {
      firstcount++;
    } else if (a[i] == second) {
      secondcount++;
    } else if (a[i] == second) {
      thirdcount++;
    } else {
      printf("No\n");
      return 0;
    }
  }
  if (second == -1) {
    if (first == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (third == -1) {
    if (first == 0) {
      if (firstcount * 2 == secondcount) {
        printf("Yes\n");
      } else {
        printf("No\n");
      }
    } else if (second == 0) {
      if (secondcount * 2 == firstcount) {
        printf("Yes\n");
      } else {
        printf("No\n");
      }
    } else {
      printf("No\n");
    }
  } else {
    if (((first ^ second) == third) && (firstcount == secondcount) &&
        (firstcount == thirdcount))
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
