#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  bool hantei = true;
  if (N % 3 == 0) {
    hantei = false;
  }
  int A, B, C;
  A = a.at(0);
  for (int i = 0; i < N; i++) {
    if (a.at(i) == A) {
      a.at(i) = -1;
    }
  }
  for (int i = 0; i < N; i++) {
    if (a.at(i) > 0) {
      B = a.at(i);
      break;
    }
  }
  for (int i = 0; i < N; i++) {
    if (a.at(i) == B) {
      a.at(i) = -1;
    }
  }
  for (int i = 0; i < N; i++) {
    if (a.at(i) > 0) {
      C = a.at(i);
      break;
    }
  }
  for (int i = 0; i < N; i++) {
    if (a.at(i) == C) {
      a.at(i) = -1;
    }
  }
  for (int i = 0; i < N; i++) {
    if (a.at(i) != -1) {
      hantei = false;
    }
  }
  vector<vector<bool>> binary(3, vector<bool>(32, false));
  for (int loop = 31; loop > -1; loop--) {
    binary.at(0).at(loop) = A % 2;
    A /= 2;
    if (A == 0) {
      break;
    }
  }
  for (int loop = 31; loop > -1; loop--) {
    binary.at(1).at(loop) = B % 2;
    B /= 2;
    if (B == 0) {
      break;
    }
  }
  for (int loop = 31; loop > -1; loop--) {
    binary.at(2).at(loop) = C % 2;
    C /= 2;
    if (C == 0) {
      break;
    }
  }
  for (int i = 0; i < 32; i++) {
    if (binary.at(0).at(i) + binary.at(1).at(i) == binary.at(2).at(i)) {
    } else {
      hantei = false;
    }
  }
  if (hantei == false) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
