1674 - Dinner
Time Limit : 1 Second
Memory Limit : 512 MB
Submission: 95
Solved: 14
- Description
We host a contest in HUST, and invite all teams to have dinner. To make them fully communicate, we decided that the teammates who come from the same school shouldn't eat at the same table. But pyy is so stupid, he doesn't know if it's possible. Can you write a program to help him?
- Input
We have multiply cases. For each case:
The first line contains two integers,
n (1<=n<=1000) — the number of schools.
m (1<=m<=1000) — the number of tables.
The second line contains n integers - a number of each school.
The third line contains m integers - the capability of each table.
- Output
For each case, if it's possible, output a "Yes"(without quotes) in a single line, otherwise, output a "No".
- sample input
-
1 2 2 1 1 1 1 1 1
- sample output
-
Yes Yes
- hint
- source
- pyy