#import"bits/stdc++.h"
using namespace std;
#define o bool
#define l int
#define v vector<l>
l n;o h(v a,v b){o r=1;for(l i=0;i<n;i++)r&=(a[i]!=b[i]);return r;}void f(o g,v a){cout<<(g?"Yes\n":"No\n");if(g)for(l e:a)cout<<e<<'\n';exit(0);}l main(){cin>>n;v a(n),b(n),c;for(l&e:a)cin>>e;for(l&e:b)cin>>e;c=b;reverse(begin(b),end(b));rotate(begin(c),begin(c)+(n/2),end(c));if(h(a,b))f(1,b);if(h(a,c))f(1,c);f(0,a);}