Problem Description

Read a string of only '(' and ')', check if it is balanced. Output YES or NO. Stop early if you ever go negative balance.

Input Format

One string s.

Output Format

YES or NO.

Sample Test Case

Input:
)()(
Output:
NO

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next