()

Problem Statement

文字列Sがある.はじめ,Sは空文字列である.
以下の処理をn個順番に行う.

処理を施した後,Sがバランスのとれた文字列であるかどうか判定せよ.

「文字列のバランスが取れている」とは,次のように定義される.

Input

入力は以下の形式に従う.与えられる数は全て整数である.

n
p_1 x_1
. . .
p_n x_n

Constraints

Output

バランスがとれているときは"YES"を,そうでなければ"NO"を1行に出力せよ.

Sample Input 1

3
( 5
) 4
) 1

Output for the Sample Input 1

YES

文字列S="((((()))))"はバランスがとれている.

Sample Input 2

5
( 2
) 2
( 3
) 1
) 2

Output for the Sample Input 2

YES

Sample Input 3

2
) 1
( 1

Output for the Sample Input 3

NO