#abc245c. [abc245_c]Choose Elements
[abc245_c]Choose Elements
Problem Statement
You are given two sequences, each of length , consisting of integers: and .
Determine whether there is a sequence of length , , satisfying all of the conditions below.
-
or , for every .
-
, for every .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If there is an that satisfies all of the conditions, print Yes
; otherwise, print No
.
Sample Input 1
5 4
9 8 3 7 2
1 6 2 9 5
Sample Output 1
Yes
satisfies all conditions.
Sample Input 2
4 90
1 1 1 100
1 2 3 100
Sample Output 2
No
No satisfies all conditions.
Sample Input 3
4 1000000000
1 1 1000000000 1000000000
1 1000000000 1 1000000000
Sample Output 3
Yes