Parentheses Balance#2479

Parentheses Balance

1 second
128 megabytes
Very easy

A string consisting of parentheses , and square brackets , is given. A bracket expression is considered correct if the following conditions are satisfied:

Write a program that determines whether a given bracket expression is correct. The length of each string does not exceed characters.

Input

The first line contains the number of test cases . Each of the following lines contains a bracket expression consisting only of the characters , , , .

Output

For each test case, print Yes if the expression is correct, and No otherwise, each on a separate line.

Examples

Example 1

Loading
Loading