#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int n = 0; n < N; n++) {
    cin >> a[n];
  }
  int max_a = 0;
  for (int n = 0; n < N; n++) {
    if (a[n] > max_a) max_a = a[n];
  }
  int keta = 1;
  while (1) {
    max_a /= 2;
    if (max_a == 1) {
      keta++;
      break;
    } else {
      keta++;
    }
  }
  string aa[N][keta];
  for (int n = 0; n < N; n++) {
    stringstream ss;
    ss << bitset<100>(a[n]);
    string s = ss.str();
    for (int k = 0; k < keta; k++) {
      aa[n][k] = s[99 - k];
    }
  }
  string res = "Yes";
  for (int k = 0; k < keta; k++) {
    int sum_one = 0;
    for (int n = 0; n < N; n++) {
      if (aa[n][k] == "1") sum_one++;
    }
    int sum_zero = N - sum_one;
    int flag = 0;
    if (N % 2 == 0 && sum_one == N / 2) flag = 1;
    if (N % 2 == 1 && sum_one == (N + 1) / 2) flag = 1;
    if ((sum_zero != N) && (flag == 0)) res = "No";
  }
  cout << res << endl;
}
