CF796F Sequence Recovery
Description
Zane once had a good sequence $ a $ consisting of $ n $ integers $ a_{1},a_{2},...,a_{n} $ — but he has lost it.
A sequence is said to be good if and only if all of its integers are non-negative and do not exceed $ 10^{9} $ in value.
However, Zane remembers having played around with his sequence by applying $ m $ operations to it.
There are two types of operations:
1\. Find the maximum value of integers with indices $ i $ such that $ l
Input Format
The first line contains two integers $ n $ and $ m $ ( $ 1
Output Format
If there does not exist a valid good sequence, print "NO" (without quotation marks) in the first line.
Otherwise, print "YES" (without quotation marks) in the first line, and print $ n $ space-separated integers $ b_{1},b_{2},...,b_{n} $ ( $ 0
Explanation/Hint
In the first sample, it is easy to verify that this good sequence is valid. In particular, its cuteness is $ 19 $ OR $ 0 $ OR $ 0 $ OR $ 0 $ OR $ 1 $ $ = $ $ 19 $ .
In the second sample, the two operations clearly contradict, so there is no such good sequence.