Balanced brackets

A string contains only the brackets ( ) [ ] { }. Print YES if every bracket is closed by the right type in the right order, otherwise NO.

Reported in: Infosys (2021–26), HCLTech (memory-based)

Input

One line: the bracket string.

Output

YES or NO.

Constraints

1 ≤ length ≤ 10^5.

Example 1

Input:
{[()]}()

Output:
YES

Example 2

Input:
([)]

Output:
NO

Hint: Push opening brackets on a stack; each closing bracket must match the top.

All coding practice