LearnPy Hub
← Arena
IntermediateRating 1300

Balanced Brackets

Given a string of the characters ()[]{}, print YES if every bracket is closed in the correct order, otherwise NO.

Input

One non-empty string.

Output

YES or NO.

Sample 1

Input
([]{})
Output
YES

Sample 2

Input
([)]
Output
NO
solution.py
Output appears here
Balanced Brackets · Python Arena problem · LearnPy Hub