#include <bits/stdc++.h>
using namespace std;
vector<long long> group[64];
vector<long long> cur;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long k;
    cin >> k;
    int res = 0;
    for (int j = 0; j < 61; j++) {
      if ((1LL << j) <= k) {
        res = j;
      }
    }
    group[res].push_back(k);
  }
  for (int i = 61; i >= 0; i--) {
    int cnt = 0;
    for (long long j : cur) {
      if (j & (1LL << i)) {
        cnt++;
      }
    }
    if (cnt + 1 < group[i].size()) {
      cout << "No" << endl;
      return 0;
    }
    if (group[i].size() == 0) continue;
    vector<long long> v2;
    int ptr = 0;
    for (int j = 0; j < group[i].size() - 1; j++) {
      v2.push_back(group[i][j]);
      bool fnd = false;
      while (!fnd) {
        if (cur[ptr] & (1LL << i)) {
          fnd = true;
        }
        v2.push_back(cur[ptr]);
        ptr++;
      }
    }
    v2.push_back(group[i].back());
    while (ptr != cur.size()) {
      v2.push_back(cur[ptr]);
      ptr++;
    }
    swap(v2, cur);
  }
  cout << "Yes" << endl;
  for (long long j : cur) {
    cout << j << ' ';
  }
  cout << endl;
}
