#include <iostream>
#include <vector>
#include <algorithm>

bool check (std::vector<int> a, std::vector<int> b) {
	bool ret = true;
	for (std::size_t i = 0; i < a.size(); i++) ret &= (a[i] != b[i]);
	return ret;
}

void answer (bool ans, std::vector<int> a) {
	std::cout << (ans ? "Yes" : "No") << '\n';
	if (ans) for (int e : a) std::cout << e << '\n';
}

int main() {
	int n;
	std::cin >> n;
	std::vector<int> a(n), b(n), c(n);
	for (int i = 0; i < n; i++) std::cin >> a[i];
	for (int i = 0; i < n; i++) { std::cin >> b[i]; c[i] = b[i]; }
	
	std::reverse(b.begin(), b.end());
	std::rotate(c.begin(), c.begin() + (n / 2), c.end());
	
	if (check(a, b)) answer(true, b);
	else if (check(a, c)) answer(true, c);
	else answer(false, a);
	return 0;
}