#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>

using namespace std;
int a[200005], b[200005];

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &a[i]);
    }
    for (int i = n; i >= 1; --i) {
        scanf("%d", &b[i]);
    }
    bool flag = true;
    for (int i = 1; i <= n; ++i) {
        if (a[i] == b[i]) {
            flag = false;
            for (int j = 1; j <= n; ++j) {
                if (b[j] != a[i] && b[i] != a[j]) {
                    swap(b[j], b[i]);
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                break;
            }
        }
    }
    if (flag) {
        printf("Yes\n");
        for (int i = 1; i <= n; ++i) {
            printf("%d ", b[i]);
        }
    } else {
        printf("No\n");
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)

typedef long long Int;

const Int INF = 1e18;


int main() {
    Int N;
    cin >> N;
    vector<Int> A(N);
    rep(i,N) cin >> A[i];

    vector<Int> dp0(N, -INF), dp1(N, -INF);

    dp0[0] = 0;
    dp1[0] = A[0];
    dp0[1] = max(A[0], A[1]);

    for(int i = 2; i<N; i++) {
        if (i % 2 == 1) {
            dp0[i] = max(dp1[i-1], A[i]+dp0[i-2]);
        }
        else {
            dp0[i] = max(dp0[i-1], A[i] + dp0[i-2]);
            dp1[i] = A[i] + dp1[i-2];
        }
    }

    cout << dp0[N-1] << endl;
}
