#Lutece0649. 括号配对问题

括号配对问题

Migrated from Lutece 649 括号配对问题

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

大家都知道算术表达式中,括号必须配对,现在任意给出一个算术表达式,判断其括号是否配对。如果配对,输出Yes,否则输出No

Input

含多组测试数据,输入首先是一个整数TT表示测试数据组数(0<T3000<T \leq 300)。随后有TT行测试数据,长度不超过10001000个字符,字符串间不含空格。

Output

对应每组测试数据,输出一行结果。

Samples

输入数据 1

2
32*(78-23)+78
32*78)-(23+78)

输出数据 1

Yes
No

Resources

wxiaoping - 2012