D. Add and Multiply
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

You are given two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. Find an array of non-negative integers $$$c$$$ of length $$$n$$$ such that if you add it to $$$a$$$ and $$$b$$$ element-wise, then the product of the numbers in each one of these arrays is the same, or say that it's impossible.

Formally, you need to find a sequence of non-negative integers $$$c_1, c_2, \ldots, c_n$$$, such that $$$(a_1 + c_1) \cdot (a_2 + c_2) \cdot \ldots \cdot (a_n + c_n) = (b_1 + c_1) \cdot (b_2 + c_2) \cdot \ldots \cdot (b_n + c_n)$$$.

Input

The first line contains one integer $$$n$$$ ($$$1 \le n \le 100\,000$$$).

The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 1000$$$).

The third line contains $$$n$$$ integers $$$b_1, b_2, \ldots, b_n$$$ ($$$1 \le b_i \le 1000$$$).

Output

If such array does not exist, output "NO". Otherwise, print "YES" in the first line. Then, print $$$n$$$ integers $$$c_1, c_2 \ldots c_n$$$ ($$$0 \le c_i \le 10^{18}$$$) — the solution to the problem. If there are multiple solutions, print any of them. It's guaranteed that if a solution exists, then there is a solution that fits the constraints.

Scoring
SubtaskPointsConstraints
19$$$n \le 2; a_i, b_i \le 10$$$
225$$$n \le 2$$$
319$$$n \le 3$$$
418$$$a_i, b_i \le 2$$$
529No additional constraints
Example
Input
4
1 2 5 4
6 1 6 2
Output
YES
6 4 1 1