300687: CF130H. Balanced brackets

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Balanced bracketstime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

A sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters «+» and «1». For example, sequences «(())()», «()» and «(()(()))» are balanced, while «)(», «(()» and «(()))(» are not.

You are given a string which consists of opening and closing round brackets. Check whether it is a balanced bracket sequence.

Input

The only line of input contains a string between 1 and 100 characters long, inclusive. Each character in the string will be «(» or «)».

Output

Output «YES» if the bracket sequence is balanced, and «NO» otherwise (quotes for clarity only).

ExamplesInput
(()(()))()
Output
YES
Input
())()
Output
NO

Input

加入题单

算法标签: