#include <bits/stdc++.h>
const long long LINF = 1e18;
const int INF = 1e8;
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n);
  long long ma = 0;
  long long zeroCount;
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
    if (a[i] == 0) {
      zeroCount++;
    }
    ma = max(ma, a[i]);
  }
  int count = 0;
  while (true) {
    if (ma == 0) {
      break;
    }
    ma = ma / 2;
    count++;
  }
  long long ans1 = 0;
  long long ans2 = 0;
  bool ans = true;
  bool yurusu = false;
  for (int i = 0; i < count; i++) {
    for (int j = 0; j < n; j++) {
      ans1 += a[j] % 2;
      a[j] /= 2;
    }
    if ((ans1 != ans2 || ans1 % 2 == 1) && i != 0 && yurusu) {
      ans = false;
    }
    ans2 = ans1;
    ans1 = 0;
    if (ans2 > 0) {
      yurusu = true;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
