Skip to content
UPEEC

Balanced Brackets

Medium#strings#stack· solved by 0 · time limit 2.0 s

Is the bracket sequence balanced? Every (, [, { must be closed by the matching bracket in the correct order. Print Yes or No.

Input

One line containing only the characters ()[]{}.

Output

Yes or No.

Constraints

1 to 10510^5 characters.

Sample 1

Input

{[()]}

Output

Yes

Sample 2

Input

([)]

Output

No

Sign in or join free to run and submit your solution.