eolymp
bolt
Try our new interface for solving problems
Problems

Simple arithmetic

Simple arithmetic

Given a sequence of digits. Determine whether to place between some of these signs "\textbf{+}" and "\textbf{-}" so you have a fixed number of \textbf{M}, but no intermediate calculations did not exceed modulo \textbf{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. \textbf{Input} Given two strings: the first line - the number of \textbf{M}, in the second row - a sequence of digits. \textbf{M} <= \textbf{2500}. The length of the input sequence does not exceed \textbf{200}. \textbf{Output} Remove one word \textbf{YES} or \textbf{NO} depending on whether there is a solution of a problem or not. \href{http://translate.google.com.ua/translate_s?hl=ru&sl=ru&tl=en&q=%D0%9F%D1%80%D0%BE%D1%81%D1%82%D0%B0%D1%8F%20%D0%B0%D1%80%D0%B8%D1%84%D0%BC%D0%B5%D1%82%D0%B8%D0%BA%D0%B0&source=translation_link}{поиск}
Time limit 1 second
Memory limit 64 MiB
Input example #1
3
112
Output example #1
NO
Source Отборочный тур Всероссийской командной олимпиады школьников 2009/2010 учебный год