eolymp
bolt
Try our new interface for solving problems

Bank

$n$ people came to some bank to get their salary of $a_1, a_2, ..., a_n$ tenge. There are total $m$ banknotes left in the bank with values $b_1, b_2, ..., b_m$ tenge correspondently. You need to determine whether bank is able to give exact salary to all people using given banknotes or not. \InputFile First line contains two integers $n$ and $m~(1 \le n, m \le 20)$ --- number of people and number of banknotes. Second line contains $n$ integers $a_1, a_2, ..., a_n~(1 \le a_i \le 1000)$ --- salary values. Third line contains $m$ integer numbers $b_1, b_2, ..., b_m~(1 \le b_i \le 1000)$ --- values of banknotes. \OutputFile Print one word "\textbf{YES}", if bank is able to pay salary. In opposite case print "\textbf{NO}".
Time limit 1 second
Memory limit 128 MiB
Input example #1
1 5
8
4 2 5 1 3
Output example #1
YES
Input example #2
2 6
9 10
5 4 8 6 3 11
Output example #2
NO
Source 2014 X Zhautykov Olympiad Almaty, Kazakhstan, January 12-18