#include <bits/stdc++.h>
using namespace std;using v=vector<int>;int n;int h(v a,v b){int r=1;for(int i=0;i<n;i++)r&=a[i]!=b[i];return r;}int f(int g,v a){cout<<(g?"Yes\n":"No\n");if(g)for(int e:a)cout<<e<<'\n';exit(0);}int main(){cin>>n;v a(n),b(n),c;for(int&e:a)cin>>e;for(int&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);}