#include <bits/stdc++.h>
using namespace std;
int N, a[100001];
int main() {
  cin >> N;
  int maxi = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    maxi = max(maxi, a[i]);
  }
  map<int, map<int, int> > cnt;
  for (int b = 1; b <= maxi; b = b << 1) {
    map<int, int> m;
    for (int i = 0; i < N; i++) {
      if (a[i] & b)
        m[1]++;
      else
        m[0]++;
    }
    cnt[b] = m;
  }
  string ans = "Yes";
  for (int b = 1; b <= maxi; b = b << 1) {
    vector<int> v2;
    v2.push_back(a[0] & b);
    bool flag = false;
    for (int i = 0; i < 2; i++) {
      map<int, int> c = cnt[b];
      if (c[i] <= 0) continue;
      c[i]--;
      v2.push_back(i);
      flag = true;
      for (int j = 2; j < N; j++) {
        int use = (v2[j - 2] & b) ^ (v2[j - 1] & b);
        if (c[use] <= 0) {
          flag = false;
          break;
        }
        flag = true;
        c[use]--;
        v2.push_back(use);
      }
    }
    if (!flag) {
      ans = "No";
      break;
    }
  }
  cout << ans << endl;
}
