#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> arr(n);
  for (long long i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  vector<bool> placed(n, false);
  vector<long long> cntBits(66, 0);
  vector<long long> res;
  for (long long bit = 60; bit >= 0; --bit) {
    long long cntCurrBit = 0;
    vector<long long> nums;
    for (long long i = 0; i < n; ++i) {
      if (placed[i]) continue;
      if (arr[i] & (1LL << bit)) {
        ++cntCurrBit;
        nums.push_back(i);
      }
    }
    if (cntCurrBit > cntBits[bit] + 1) {
      cout << "No\n";
      return 0;
    }
    if (cntCurrBit == 0) continue;
    vector<long long> newRes;
    newRes.push_back(arr[nums[0]]);
    long long pos = 1;
    for (long long i = 0; i < res.size(); ++i) {
      newRes.push_back(res[i]);
      if (res[i] & (1LL << bit)) {
        if (pos < nums.size()) {
          newRes.push_back(arr[nums[pos++]]);
        }
      }
    }
    for (long long pos : nums) {
      placed[pos] = true;
      for (long long bit2 = 60; bit2 >= 0; --bit2) {
        if (arr[pos] & (1LL << bit2)) {
          ++cntBits[bit2];
        }
      }
    }
    res.swap(newRes);
  }
  cout << "Yes\n";
  assert(res.size() == n);
  for (long long i = 0; i < n; ++i) {
    cout << res[i] << ' ';
  }
  cout << '\n';
}
