#include <bits/stdc++.h>
using namespace std;
int main() {
  long long pw[32];
  long long n;
  long long i, j;
  long long base, val = 1;
  long long input;
  vector<long long> bin[2];
  vector<long long> arr;
  bool all[2];
  bool reverse;
  for (i = 0; i < 32; i++) {
    pw[i] = val;
    val *= 2;
  }
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &input);
    arr.push_back(input);
  }
  if (n == 3) {
    for (i = 0; i < 32; i++) {
      bin[0].clear();
      bin[1].clear();
      for (j = 0; j < arr.size(); j++) {
        val = arr[j] & pw[i];
        val = !!val;
        bin[val].push_back(arr[j]);
      }
      if (bin[1].size() == 1 || bin[1].size() == 3) {
        printf("No\n");
        return 0;
      }
    }
    printf("Yes\n");
    return 0;
  }
  for (i = 0; i < 32; i++) {
    bin[0].clear();
    bin[1].clear();
    for (j = 0; j < arr.size(); j++) {
      val = arr[j] & pw[i];
      val = !!val;
      bin[val].push_back(arr[j]);
    }
    if (bin[0].size() != n && bin[0].size() != n / 2) {
      printf("No\n");
      return 0;
    }
    if (bin[0].size() == n / 2) {
      break;
    }
  }
  if (i >= 31) {
    printf("Yes\n");
    return 0;
  }
  base = i;
  for (i = base + 1; i < 32; i++) {
    all[0] = true;
    all[1] = true;
    reverse = false;
    for (j = 1; j < bin[0].size(); j++) {
      val = bin[0][j] & pw[i];
      val = !!val;
      all[!val] = false;
      if (val && n % 2) {
        printf("No\n");
        return 0;
      }
    }
    if (!all[0] && !all[1]) {
      printf("No\n");
      return 0;
    }
    if (all[1]) {
      reverse = true;
    }
    all[0] = true;
    all[1] = true;
    for (j = 0; j < bin[1].size(); j++) {
      val = bin[1][j] & pw[i];
      val = !!val;
      all[!val] = false;
    }
    if (!all[0] && !all[1]) {
      printf("No\n");
      return 0;
    }
    if (reverse && all[1]) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
