


Input: ‘N’ = 5, ‘TARGET’ = 5
‘BOOK’ = [4, 1, 2, 3, 1]
Output: YES
Explanation:
Sam can buy 4 pages book and 1 page book.
The first line of the input contains two integers, ‘N’ and ‘TARGET’, representing the number of books and target pages.
The next line of each test case contains ‘N’ space-separated integers representing the number of pages.
Return a string YES/NO, if it is possible for sam to read any 2 books and he can meet his ‘TARGET’ number of pages.
The solution to the problem lies in using a hash-map to check if there is any book with (TARGET-number of pages in current book) pages already present. This can be done by traversing the whole array once.