LearnPy Hub
← Arena
IntermediateRating 1400

Brackets With Wildcards

Each * can stand for (, ) or nothing. Print YES if the string can be a balanced bracket string.

Input

One string of (, ) and *.

Output

YES or NO.

Sample 1

Input
()
Output
YES

Sample 2

Input
(*)
Output
YES
solution.py
Output appears here
Brackets With Wildcards · Python Arena problem · LearnPy Hub