Simple arithmetic
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a sequence of digits. Determine whether to place between some of these signs "+" and "-" so you have a fixed number of M, but no intermediate calculations did not exceed modulo 10000. In the output file display one of the examples or the message that there is no solution if there are no solutions. Sign before the first put the number required.
Input Given two strings: the first line - the number of M, in the second row - a sequence of digits. M <= 2500. The length of the input sequence does not exceed 200. Output Remove one word YES or NO depending on whether there is a solution of a problem or not.
Examples
Input #1
Answer #1
Submissions 123
Acceptance rate 10%