#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;
const int N = 200010;
int n, a[N], b[N], cnt, tot;

int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[n - i + 1];
    int l = 1, r = n, st = 0, ed = -1;
    for (int i = 1; i <= n; i++)
        if (a[i] == b[i]) {
            if (!st) st = i;
            ed = i;
        }
    for (int j = st; j <= ed; j++) {
        if (a[l] ^ b[j] && b[l] ^ b[j]) swap(b[j], b[l++]);
        else if (a[r] ^ b[j] && b[r] ^ b[j]) swap(b[j], b[r--]);
        else puts("No"), exit(0);
    }
    puts("Yes");
    for (int i = 1; i <= n; i++) printf("%d%c", b[i], " \n"[i == n]);
    return 0;
}

#include <iostream>
#include <string.h>
#include <sstream>
#include <ctype.h>
using namespace std;

string com[3] = {"the", "this", "that"};

string incAlpha (string str, int k) {
    for (int i = 0; i < str.size(); i++) {
        if(isalpha(str[i])) str[i] = ((str[i] + k - 'a') % 26) + 'a'; 
    }
    return str;
}

bool strsrch(string str1, string str2) {
    for (int i = 0; i < str1.size(); i++) {
        if (str1[i] == str2[0]) {
            bool flag = true;
            if (i + str2.size() > str1.size()) flag = false;
            for (int j = 0; j < str2.size() && flag; j++) {
                if (str1[i + j] != str2[j]) flag = false;
            }
            if (flag) return true;
        }
    }

    return false;
}

bool check (string str) {
    for (int i = 0; i < 3; i++) {
        if (strsrch(str, com[i])) return true;
    }
    return false;
}

int main ()
{
    string str;
    while (getline(cin, str)) {
        for (int i = 0; i <= 26; i++) {
            if (check((incAlpha(str, i)))) {
                cout << (incAlpha(str, i)) << endl;
                break;
            }
        }
    }

    return 0;
}