e-olymp
Problems

Bracket sequence

Bracket sequence

The bracket sequence is an arithmetic expression, from which all the numbers and signs are removed. For example,

1+(((2+3)+5)+(3+4))((())())

Input

Given a sequence of opening and closing brackets of length not more than 4000000.

Output

Print "YES" if the sequence is bracket. Otherwise print "NO".

Time limit 2 second
Memory limit 128 MiB
Input example #1
((())())
Output example #1
YES
Input example #2
(()
Output example #2
NO