#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 w(1001000); rep(i, n){ V vv; rep(j, 20) if(((v[i]>>j)&1)==0) vv.eb(j); if((1<n) continue; ll x = (1< ans(n, -1); ans[a] = A; ans[b] = B; ll cnt = 1; while(cnt==A||cnt==B) cnt++; rep(i, n) if(ans[i]==-1){ ans[i] = cnt; cnt++; while(cnt==A||cnt==B) cnt++; } rep(i, n) cout << ans[i] << " "; cout << endl; swap(ans[a],ans[b]); rep(i, n) cout << ans[i] << " "; cout << endl; return; } } {VV vv(32); rep(i, n) vv[v[i]%32].eb(i); rep(i, 32) rep(j, 32){ if(i==j) if(vv[i].size()>=2){ V ans(n, -1); ll x = vv[i][0], y = vv[i][1]; ll a = -1, b = -1; REP(i,1, min(n+1, 65ll)) REP(j,1,i){ ll aa = (v[x]+i)^(v[y]+j); ll bb = (v[y]+i)^(v[x]+j); if(aa!=bb) continue; a = i; b = j; } if(a == -1) continue; ans[x] = a; ans[y] = b; ll cnt = 1; while(cnt==a||cnt==b) cnt++; rep(i, n) if(ans[i] == -1){ ans[i] = cnt; cnt++; while(a==cnt||b==cnt) cnt++; } rep(i, n) cout << ans[i] << " "; cout << endl; swap(ans[x], ans[y]); rep(i, n) cout << ans[i] << " "; cout << endl; return; } if(i!=j) if(vv[i].size()>=1 && vv[j].size()>=1){ V ans(n, -1); ll x = vv[i][0], y = vv[j][0]; ll a = -1, b = -1; REP(i,1, min(n+1, 65ll)) REP(j,1,i){ ll aa = (v[x]+i)^(v[y]+j); ll bb = (v[y]+i)^(v[x]+j); if(aa!=bb) continue; a = i; b = j; } if(a == -1) continue; ans[x] = a; ans[y] = b; ll cnt = 1; while(cnt==a||cnt==b) cnt++; rep(i, n) if(ans[i] == -1){ ans[i] = cnt; cnt++; while(a==cnt||b==cnt) cnt++; } rep(i, n) cout << ans[i] << " "; cout << endl; swap(ans[x], ans[y]); 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(); }