#apc001b. [apc001_b]Two Arrays
[apc001_b]Two Arrays
Problem Statement
You are given two integer sequences of length : and . Determine if we can repeat the following operation zero or more times so that the sequences and become equal.
Operation: Choose two integers and (possibly the same) between and (inclusive), then perform the following two actions simultaneously:
- Add to .
- Add to .
Constraints
- ()
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
If we can repeat the operation zero or more times so that the sequences and become equal, print Yes
; otherwise, print No
.
Sample Input 1
3
1 2 3
5 2 2
Sample Output 1
Yes
For example, we can perform three operations as follows to do our job:
- First operation: and . Now we have , .
- Second operation: and . Now we have , .
- Third operation: and . Now we have , .
Sample Input 2
5
3 1 4 1 5
2 7 1 8 2
Sample Output 2
No
Sample Input 3
5
2 7 1 8 2
3 1 4 1 5
Sample Output 3
No