#P1413D. Shurikens

    ID: 5566 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>data structuresgreedyimplementation*1700

Shurikens

No submission language available for this problem.

Description

Tenten runs a weapon shop for ninjas. Today she is willing to sell nn shurikens which cost 11, 22, ..., nn ryo (local currency). During a day, Tenten will place the shurikens onto the showcase, which is empty at the beginning of the day. Her job is fairly simple: sometimes Tenten places another shuriken (from the available shurikens) on the showcase, and sometimes a ninja comes in and buys a shuriken from the showcase. Since ninjas are thrifty, they always buy the cheapest shuriken from the showcase.

Tenten keeps a record for all events, and she ends up with a list of the following types of records:

  • + means that she placed another shuriken on the showcase;
  • - x means that the shuriken of price xx was bought.

Today was a lucky day, and all shurikens were bought. Now Tenten wonders if her list is consistent, and what could be a possible order of placing the shurikens on the showcase. Help her to find this out!

The first line contains the only integer nn (1n1051\leq n\leq 10^5) standing for the number of shurikens.

The following 2n2n lines describe the events in the format described above. It's guaranteed that there are exactly nn events of the first type, and each price from 11 to nn occurs exactly once in the events of the second type.

If the list is consistent, print "YES". Otherwise (that is, if the list is contradictory and there is no valid order of shurikens placement), print "NO".

In the first case the second line must contain nn space-separated integers denoting the prices of shurikens in order they were placed. If there are multiple answers, print any.

Input

The first line contains the only integer nn (1n1051\leq n\leq 10^5) standing for the number of shurikens.

The following 2n2n lines describe the events in the format described above. It's guaranteed that there are exactly nn events of the first type, and each price from 11 to nn occurs exactly once in the events of the second type.

Output

If the list is consistent, print "YES". Otherwise (that is, if the list is contradictory and there is no valid order of shurikens placement), print "NO".

In the first case the second line must contain nn space-separated integers denoting the prices of shurikens in order they were placed. If there are multiple answers, print any.

Samples

Sample Input 1

4
+
+
- 2
+
- 3
+
- 1
- 4

Sample Output 1

YES
4 2 3 1

Sample Input 2

1
- 1
+

Sample Output 2

NO

Sample Input 3

3
+
+
+
- 2
- 1
- 3

Sample Output 3

NO

Note

In the first example Tenten first placed shurikens with prices 44 and 22. After this a customer came in and bought the cheapest shuriken which costed 22. Next, Tenten added a shuriken with price 33 on the showcase to the already placed 44-ryo. Then a new customer bought this 33-ryo shuriken. After this she added a 11-ryo shuriken. Finally, the last two customers bought shurikens 11 and 44, respectively. Note that the order [2,4,3,1][2, 4, 3, 1] is also valid.

In the second example the first customer bought a shuriken before anything was placed, which is clearly impossible.

In the third example Tenten put all her shurikens onto the showcase, after which a customer came in and bought a shuriken with price 22. This is impossible since the shuriken was not the cheapest, we know that the 11-ryo shuriken was also there.