Bracket sequence
Very easy
Execution time limit is 4 seconds
Runtime memory usage limit is 128 megabytes
The bracket sequence is a correct arithmetic expression from which all numbers and operation signs have been removed. For example,
Input
A sequence of opening and closing brackets is given. The length of the sequence is no more than .
Output
Print "YES" if the bracket sequence is correct and "NO" otherwise.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 11K
Acceptance rate 36%