题目描述
Problem Statement
There is pasta consisting of N noodles at Takahashi's home. The length of the i-th noodle is A_i.
Takahashi has a meal plan for the next M days.
On the i-th day, he is going to choose a pasta noodle of length exactly B_i and eat it.
If no such noodle is available on any day, his plan fails.
Additionally, he cannot eat the same noodle on multiple days.
Can Takahashi accomplish his meal plan?
Input
Input is given from Standard Input in the following format:
N M
$A_1 A_2 \ldots A_N$
$B_1 B_2 \ldots B_M$
Output
If Takahashi can accomplish his meal plan, print Yes; otherwise, print No.
Constraints
- $1 \leq M \leq N \leq 1000$
- $1 \leq A_i \leq 10^9$
- $1 \leq B_i \leq 10^9$
- All values in input are integers.
Sample Input 1
3 2
1 1 3
3 1
Sample Output 1
Yes
He can eat the 3-rd noodle on the 1-st day and the 1-st noodle on the 2-nd day, so his meal plan is feasible.
Sample Input 2
1 1
1000000000
1
Sample Output 2
No
A noodle of length exactly 1 is needed.
Sample Input 3
5 2
1 2 3 4 5
5 5
Sample Output 3
No
Since there are only 1 noodle of length 5, he cannot have a meal on the 2-nd day.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分