import java.util.*;
public class Main {
public static boolean check(String s){
Stack st=new Stack<>();
char[] str=s.toCharArray();
for(char ch:str){
if(ch==β)β){
char top=st.peek();
st.pop();
boolean flag=true;
while(top!=β(β){
if(top=='+' || top=='-'||top=='/'||top=='*')
flag=false;
top=st.peek();
st.pop();
}
if(flag==true)
return true;}
else{
st.push(ch);}
}return false; }
public static void find(String stri){
boolean ans=check(stri);
if(ans==true){
System.out.println("Yes");
}
else
System.out.println("No");}
public static void main(String args[]) {
try{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++){
String stri=sc.nextLine();
find(stri);
}
}
catch(Exception e){System.out.println(e);}
}
}
i cannot understand what is error in this codde.