Tenten runs a weapon shop for ninjas. Today she is willing to sell $n$ shurikens which cost $1$, $2$, ..., $n$ 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 $x$ 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!


-----Input-----

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

The following $2n$ lines describe the events in the format described above. It's guaranteed that there are exactly $n$ events of the first type, and each price from $1$ to $n$ 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 $n$ space-separated integers denoting the prices of shurikens in order they were placed. If there are multiple answers, print any.


-----Examples-----
Input
4
+
+
- 2
+
- 3
+
- 1
- 4

Output
YES
4 2 3 1 

Input
1
- 1
+

Output
NO

Input
3
+
+
+
- 2
- 1
- 3

Output
NO



-----Note-----

In the first example Tenten first placed shurikens with prices $4$ and $2$. After this a customer came in and bought the cheapest shuriken which costed $2$. Next, Tenten added a shuriken with price $3$ on the showcase to the already placed $4$-ryo. Then a new customer bought this $3$-ryo shuriken. After this she added a $1$-ryo shuriken. Finally, the last two customers bought shurikens $1$ and $4$, respectively. Note that the order $[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 $2$. This is impossible since the shuriken was not the cheapest, we know that the $1$-ryo shuriken was also there.

Difficulty: interview

Starter code:

Solutions:
import sys
import heapq
input = sys.stdin.readline


def main():
    N = int(input())
    S = [[x for x in input().split()] for _ in range(2 * N)]

    q = []
    ans = []
    for s in S[::-1]:
        if s[0] == "-":
            heapq.heappush(q, int(s[1]))
        else:
            if q:
                c = heapq.heappop(q)
                ans.append(c)
            else:
                print("NO")
                return

    ans2 = ans[::-1]

    q = []
    current = 0
    for s in S:
        if s[0] == "-":
            c = heapq.heappop(q)
            if c != int(s[1]):
                print("NO")
                return
        else:
            heapq.heappush(q, ans2[current])
            current += 1

    print("YES")
    print(*ans2)


def __starting_point():
    main()

__starting_point()

from collections import defaultdict as _defaultdict
import sys as _sys


def main():
    n, = _read_ints()
    events = _read_events(2 * n)
    try:
        result = restore_shurikens_order(events, n)
    except ValueError:
        print("NO")
    else:
        print("YES")
        print(*result)


def _read_events(events_n):
    for i_event in range(events_n):
        event_type, *event_args = _read_line().split(' ')
        if event_type == '+':
            assert len(event_args) == 0
            event = (PLACE_SHURIKEN_ID,)
        else:
            assert event_type == '-'
            assert len(event_args) == 1
            event = (BUY_SHURIKEN_ID, int(event_args[0]))
        yield event


PLACE_SHURIKEN_ID = 0
BUY_SHURIKEN_ID = 1


def restore_shurikens_order(events, shurikens_n):
    result = [None] * shurikens_n
    
    limits_tree = [0] * (shurikens_n + 1 + 1)
    limits_counter = _defaultdict(int)
    sources_by_limits = [[] for limit in range(shurikens_n+1)]
    
    next_placement_index = 0
    
    for event in events:
        
        if event[0] == PLACE_SHURIKEN_ID:
            limit = 1
            _fenwick_add(limits_tree, limit, 1)
            sources_by_limits[limit].append(next_placement_index)
            limits_counter[limit] += 1
            next_placement_index += 1
        
        else:
            assert event[0] == BUY_SHURIKEN_ID
            item_to_buy = event[1]
            if _fenwick_prefix_sum(limits_tree, item_to_buy) == 0:
                raise ValueError("unable to restore shurikens order")
            
            limits_can_be_removed_n = _fenwick_prefix_sum(limits_tree, item_to_buy)
            
            min_limit_to_remove = 1
            max_limit_to_remove = item_to_buy
            while min_limit_to_remove != max_limit_to_remove:
                mid_limit_to_remove = (min_limit_to_remove + max_limit_to_remove) >> 1
                if limits_can_be_removed_n \
                        - _fenwick_prefix_sum(limits_tree, mid_limit_to_remove) == 0:
                    max_limit_to_remove = mid_limit_to_remove
                else:
                    min_limit_to_remove = mid_limit_to_remove + 1
            limit_to_remove = min_limit_to_remove
            
            _fenwick_add(limits_tree, limit_to_remove, -1)
            result[sources_by_limits[limit_to_remove].pop()] = item_to_buy
            limits_counter[limit_to_remove] -= 1
            
            moved_limits = _fenwick_move_all_before_to(limits_tree, item_to_buy)
            for limit in moved_limits:
                moved_n = limits_counter[limit]
                del limits_counter[limit]
                limits_counter[item_to_buy] += moved_n
                assert moved_n > 0
                sources_from = sources_by_limits[limit]
                sources_to = sources_by_limits[item_to_buy]
                assert len(sources_from) == moved_n
                if len(sources_from) > len(sources_to):
                    sources_to, sources_from = sources_from, sources_to
                    sources_by_limits[item_to_buy], sources_by_limits[limit] \
                        = sources_to, sources_from
                sources_to.extend(sources_from)
                sources_from.clear()
    
    return result


def _fenwick_prefix_sum(tree, index):
    index += 1
    result = 0
    while index != 0:
        result += tree[index]
        index -= index & (-index)
    return result


def _fenwick_add(tree, index, value):
    index += 1
    while index < len(tree):
        tree[index] += value
        index += index & (-index)


def _fenwick_move_all_before_to(tree, index_arg):
    index_arg += 1
    planned_additions = []
    
    index = index_arg
    while index < len(tree):
        father_last_i = index - (index & (-index))
        segment_begin = father_last_i + 1
        planned_additions.append((index, _fenwick_prefix_sum(tree, segment_begin - 1 - 1)))
        index += index & (-index)
    
    queue_to_make_segments_zero = []
    i = index_arg - 1
    while i != 0:
        if tree[i] != 0:
            queue_to_make_segments_zero.append(i)
        i -= i & (-i)
    
    i_queue = 0
    while i_queue < len(queue_to_make_segments_zero):
        i = queue_to_make_segments_zero[i_queue]
        # Make all elements zero in the segment of i
        # Example:
        # i = 11 0100 0000
        # j = 11 0010 0000  (initial)
        # j = 11 0011 0000
        # j = 11 0011 1000
        # j = 11 0011 1100
        # j = 11 0011 1110
        # j = 11 0011 1111
        sum_in_that_segment_except_last = 0
        last_i_digit = i & (-i)
        j = i - (last_i_digit >> 1)
        if j != i:
            if tree[j] != 0:
                queue_to_make_segments_zero.append(j)
                sum_in_that_segment_except_last += tree[j]
            while j & 1 != 1:
                j += (j & (-j)) >> 1
                if tree[j] != 0:
                    queue_to_make_segments_zero.append(j)
                    sum_in_that_segment_except_last += tree[j]
        if i & 1 == 1 or tree[i] - sum_in_that_segment_except_last != 0:
            yield i - 1
        tree[i] = 0
        
        i_queue += 1
    
    for index, value_to_add in planned_additions:
        tree[index] += value_to_add


def _read_line():
    result = _sys.stdin.readline()
    assert result[-1] == "\n"
    return result[:-1]


def _read_ints():
    return list(map(int, _read_line().split()))


def __starting_point():
    main()

__starting_point()