A string made only of the characters ( ) [ ] { } is balanced if every opening bracket is closed by the same kind of bracket in the correct order. Decide whether the given string is balanced.
One line containing the string.
Print YES if balanced, otherwise NO.
1 <= length <= 200000
1000 ms256 MB
([]{})YES
([)]
NO
The square bracket is closed while the round bracket is still open.