E. Horse Racing In The Wilderness (horse)
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output
Examples
Input
5
1 2 3 4 5
1 3 2 6 7
2 3 9 11 9
Output
Yes
1 2 3 4 5
1 3 3 6 7
Input
5
0 2 0 3 0
1 2 3 3 4
2 4 4 4 5
Output
Yes
1 2 4 3 5
1 2 3 3 4
Input
5
0 2 0 1 0
1 2 3 4 1
2 3 4 5 5
Output
No