#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000001;
const long long MOD = 1e9 + 7;
const long double EPS = 1e-9;
vector<long long> mx[100];
vector<long long> ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    long long b;
    cin >> b;
    int pos = 0;
    for (int j = 0; j < 60; ++j)
      if (b & (1ll << j)) pos = j;
    mx[pos].push_back(b);
  }
  for (int i = 59; i >= 0; --i) {
    int col = 0;
    for (long long el : ans)
      if (el & (1ll << i)) ++col;
    if (col + 1 < mx[i].size()) {
      cout << "No";
      return 0;
    }
    vector<long long> tmp;
    int it1 = 0;
    int it2 = 1;
    if (!mx[i].empty()) {
      tmp.push_back(mx[i].front());
      while (it1 < ans.size() && it2 < mx[i].size()) {
        tmp.push_back(ans[it1]);
        if (ans[it1] & (1ll << i)) tmp.push_back(mx[i][it2++]);
        ++it1;
      }
      while (it1 < ans.size()) tmp.push_back(ans[it1++]);
      while (it2 < mx[i].size()) tmp.push_back(mx[i][it2]);
      ans = tmp;
    }
  }
  cout << "Yes\n";
  for (auto el : ans) cout << el << " ";
}
