P6956 [NEERC 2017] Easy Quest

Description

A young hero is starting his heroic life. The wise wizard suggested him an easy first quest. During this quest our young hero meets $n$ magical creatures, in specific order. In order to help the young hero, the wizard gave him a clue -- a list of $n$ integers $a_{i}.$ If $a_{i}$ is positive, then the i-th magical creature is benevolent and gives to our hero one magical item of type $a_{i}.$ The hero can keep several items of the same type. If $a_i$ is negative, then the i-th magical creature is evil and in order to defeat it the young hero needs one magical item of type $−a_{i}.$ All magical items are fragile and can be used only once. If $a_{i}$ is zero, then the i-th creature is a unicorn. It gives the hero any magical item he asks for, but only one. Your task is to help the young hero to finish the first quest, defeating all enemies on the way, or say that it is impossible.

Input Format

The first line of input contains one integer $n (1 \le n \le 1000)$ . The second line contains $n$ integers $a_{i} (−1000 \le a_{i} \le 1000)$ .

Output Format

If it is impossible to defeat all enemies, then output one string `No`. If it is possible, then output string `Yes`, and in the next line output the types of items the hero should ask the unicorns for, in order they meet during the quest. Types must be integers in range from $1$ to $1000$ inclusive. If there are several solutions, output any of them.

Explanation/Hint

Time limit: 3 s, Memory limit: 512 MB. spj provider:@[shenyouran](/user/137367).