Decide whether M banknotes can be distributed to N people so each person receives exactly the owed salary.
NNN people came to a bank to collect their salaries. Person iii is owed aia_iai tenge. The bank has MMM banknotes left, and banknote jjj is worth bjb_jbj tenge.
A banknote cannot be split, and each banknote goes to at most one person. Decide whether the bank can hand every person an amount equal to that person's salary. Banknotes may be left unused.
The first line contains the number of people NNN and the number of banknotes MMM (1≤N≤151 \le N \le 151≤N≤15, 1≤M≤151 \le M \le 151≤M≤15).
The second line contains the salaries a1,a2,…,aNa_1, a_2, \dots, a_Na1,a2,…,aN (1≤ai≤10001 \le a_i \le 10001≤ai≤1000).
The third line contains the banknote values b1,b2,…,bMb_1, b_2, \dots, b_Mb1,b2,…,bM (1≤bj≤10001 \le b_j \le 10001≤bj≤1000).
Print YES if the bank can pay every salary exactly. Otherwise print NO.
YES
NO