#codefestival2015qualBc. [codefestival_2015_qualB_c]Hotel
[codefestival_2015_qualB_c]Hotel
Problem Statement
Mr. Takahashi runs a -room hotel. parties have reservations today, but unfortunately he forgot to make sure that it is possible to assign rooms to all the reservations.
Each reservation needs to be assigned a room with the capacity of at least the size of the party. Exactly one room should be assigned to each reservation: it is not allowed to assign more than one room to one reservation, or assign one room to more than one reservation.
Determine whether it is possible to assign rooms to all reservations following the restrictions.
Input
Input is given from Standard Input in the following format:
... ...
- The first line contains two integer and
- The second line contains space-separated integers For each represents the capacity of the room.
- The third line contains space-separated integers For each represents the size of the party making the reservation.
Output
Print YES
in a single line if it is possible to assign rooms to all reservations following the restrictions. Print NO
otherwise. Be sure to print a newline at the end of output.
Partial Points
Partial points may be awarded in this problem:
- points will be awarded for passing the test set satisfying , .
- Another points will be awarded for passing the test set without additional constraints.
入力例1
3 2
2 2 3
3 1
出力例1
YES
入力例2
3 2
2 2 3
3 3
出力例2
NO
入力例3
3 4
10 10 10
1 1 1 1
出力例3
NO
入力例4
10 10
10 9 8 7 6 5 4 3 2 1
10 9 8 7 6 5 4 3 2 1
出力例4
YES