Rekha inherited the salt store at the wheat plains of Amberfield along with its curious bookkeeping system for scrolls. Time to make sense of it. Task: A string contains only '(' and ')'. Print YES if it is a balanced bracket sequence, otherwise NO. Input format: One line with a string of parentheses. Output format: Print YES or NO. Constraints: 1 <= |s| <= 1478; characters are '(' and ')'.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= |s| <= 1478; characters are '(' and ')'.
