Bracket sequence#5327

Bracket sequence

4 sekonda
128 megabajt
Shumë e lehtë

The bracket sequence is a correct arithmetic expression from which all numbers and operation signs have been removed. For example,

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

Hyrja

A sequence of opening and closing brackets is given. The length of the sequence is no more than 4 \cdot 10^6.

Dalja

Print "YES" if the bracket sequence is correct and "NO" otherwise.

Shembuj

Shembulli 1

Loading
Loading

Shembulli 2

Loading
Loading