#include <bits/stdc++.h>
using namespace std;
int num[10], mn[10];
int main() {
  int n, ty = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a, fo = 0;
    scanf("%d", &a);
    for (int j = 0; j < ty; j++) {
      if (num[j] == a) {
        fo = 1;
        mn[j]++;
        break;
      }
    }
    if (fo == 0) {
      num[ty] = a;
      mn[ty] = 1;
      ty++;
      if (ty > 3) {
        printf("No");
        return 0;
      }
    }
  }
  if (ty == 1) {
    if (num[0] == 0) {
      printf("Yes");
      return 0;
    } else {
      printf("No");
      return 0;
    }
  } else if (ty == 2) {
    if (num[0] == 0 || num[1] == 0) {
      int ano;
      if (num[0] != 0) {
        if (mn[0] == 2 * mn[1]) {
          printf("Yes");
          return 0;
        } else {
          printf("No");
          return 0;
        }
      } else {
        if (mn[1] == 2 * mn[0]) {
          printf("Yes");
          return 0;
        } else {
          printf("No");
          return 0;
        }
      }
    } else {
      printf("No");
      return 0;
    }
  } else if (ty == 3) {
    if (num[0] ^ num[1] == num[2]) {
      if (mn[0] == mn[1] && mn[1] == mn[2] && mn[0] == mn[2]) {
        printf("Yes");
        return 0;
      } else {
        printf("No");
        return 0;
      }
    } else {
      printf("No");
      return 0;
    }
  } else
    printf("No");
}
