#include <bits/stdc++.h>
bool is_biexp(int num) {
  int compare = 1;
  for (int i = 0; i < 32; i++) {
    if (compare == num) {
      return true;
    }
    compare <<= 1;
  }
  return false;
}
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  bool can = true;
  bool all0 = true;
  for (int i = 0; i < n; i++) {
    if (a[i] != 0) {
      all0 = false;
    }
  }
  if (all0) {
    printf("Yes\n");
    return 0;
  }
  std::map<int, int> count;
  for (int i = 0; i < n; i++) {
    count[a[i]]++;
  }
  if (count.size() > 3) {
    printf("No\n");
    return 0;
  } else if (count.size() == 2) {
    int set[2], num[2];
    auto itr = count.begin();
    set[0] = itr->first, num[0] = itr->second;
    itr++;
    set[1] = itr->first, num[1] = itr->second;
    if (num[0] * 2 == num[1] && set[0] == 0 ||
        num[1] * 2 == num[0] && set[1] == 0) {
      printf("Yes\n");
      return 0;
    } else {
      printf("No\n");
      return 0;
    }
  } else if (count.size() == 3) {
    int set[3], num[3];
    auto itr = count.begin();
    set[0] = itr->first;
    num[0] = itr->second;
    itr++;
    set[1] = itr->first;
    num[1] = itr->second;
    itr++;
    set[2] = itr->first;
    num[2] = itr->second;
    if (num[0] == num[1] && num[1] == num[2]) {
      if (set[0] == set[1] ^ set[2] && set[1] == set[2] ^ set[0] &&
          set[2] == set[0] ^ set[1]) {
        printf("Yes\n");
        return 0;
      } else {
        printf("No\n");
        return 0;
      }
    } else {
      printf("No\n");
      return 0;
    }
  } else {
    printf("No\n");
    return 0;
  }
}
