import java.util.Scanner;

public class Main {
    public static void main(String[] args)  {
       Scanner sc = new Scanner(System.in);
       int flag=0;
       while(sc.hasNext()){
           int no=0;
           int count=0;
           int kind=0;
           for(char a = sc.nextchar(); a!='.'  && sc.hasNext() && no==0 ; a = sc.nextchar()){
                if(a=='('){
                    count+=1;
                    kind=1;
                }
                if(a=='['){
                    count+=2;
                    kind=2;
                }
                
                if(a==')'){
                    if(kind==1) count-=1;
                    else {
                        System.out.println("no");
                        no=1;
                    }
                }
                if(a==']'){
                    if(kind==2) count-=2;
                    else {
                        System.out.println("no");
                        no=1;
                    } 
                }
                
                if(count==0) System.out.println("yes");
                else System.out.println("no");
           }
           
       }
    }
}

