#include using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; template using V = vector; template using VV = V>; template using VVV = V>; template using VVVV = VV>; #define rep(i,n) for(ll i=0ll;i void chmin(T& t, const U& u) { if (t > u) t = u; } template void chmax(T& t, const U& u) { if (t < u) t = u; } // cin.tie(nullptr); // ios::sync_with_stdio(false); // cout << fixed << setprecision(20); ll Rnd(ll L=0, ll R=mod99){ return rand()%(R-L)+L; } void solve(){ ll n; cin >> n; V v(n); rep(i,n) cin >> v[i]; VV pos(200100); rep(i, n) pos[v[i]].eb(i); rep(i, 200100) if(pos[i].size()>=2){ V ans(n); cout << "Yes" << endl; rep(i, n){ cout << i+1 << " "; ans[i] = i+1; } cout << endl; swap(ans[pos[i][0]],ans[pos[i][1]]); all(i,ans) cout << i << " "; cout << endl; return; } VV vv(300000); rep(i, n){ ll x = 0, y = 0;; rep(j, 20) if(((v[i]>>j)&1)==0){ if(x){ y += (1<=n+1) continue; V ans(n, -1); ans[vv[x+y][0]] = x; ans[vv[x+y][1]] = y; ll cnt = 1; rep(i, n) if(ans[i] == -1){ ans[i] = cnt; cnt++; while(cnt == x || cnt==y) cnt++; } rep(i, n) cout << ans[i] << " "; cout << endl; swap(ans[vv[x][0]], ans[vv[x][1]]); rep(i, n) cout << ans[i] << " "; cout << endl; return; } cout << -1 << endl; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t=1; // cin >> t; rep(i,t) solve(); }