#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  cin >> n;
  long int a[n];
  unordered_map<long int, long int> mp;
  for (long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long int i = 0; i < n; i++) {
    for (long int j = 31; j >= 0; j--) {
      long int temp = a[i] >> j;
      if (temp & 1) {
        mp[j]++;
      }
    }
  }
  for (long int j = 31; j >= 0; j--) {
    if (mp[j] == 0) {
      continue;
    }
    if (mp[j] != 2) {
      cout << "No";
      exit(0);
    }
  }
  cout << "Yes";
  return 0;
}
