#include <studio.h>
#include <string.h>
int f;
char s[101];
void judge(int n,,char c){
int i;
for(i=n+1;s[i]!='\0';i++){
if(c=='('){
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(s[i]==']')
f=0;
if(s[i]==')')
break;
}
else if(c=='['){
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(s[i]==')')
f=0;
if(s[i]==']')
break;
}
}
}
int main(void){
while(1){
f=1;
fgets(s,101,stdin);
s[strlen(s)]='\0';
if(s[0]=='.'&&strlen(s)==1)
break;
int i;
for(i=0;s[i];i++)
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(f)
puts("yes");
else
puts("no");
}
return 0;
}