#T312. 表达式括号匹配

表达式括号匹配

Description

Assume an expression consists of lowercase English letters, operators (+, -, *, /), and left/right parentheses (round brackets), with "@" as the end marker of the expression. Write a program to check whether the left and right parentheses in the expression are matched. If they match, return "YES"; otherwise, return "NO". The expression length is less than 255, and the number of left parentheses is fewer than 20.

Input Format

A single line containing the expression.

Output Format

A single line, either "YES" or "NO".

2*(x+y)/(1-x)@
YES

(25+x)*(a*(a+b+b)@
NO

Hint

【Sample Input 2】 (25+x)*(a*(a+b+b)@ 【Sample Output 2】 NO