#include<stdio.h>
#include<string.h>
char a[51];
int main(){
char test[51];
while(gets(test)){
int len=strlen(test), ans=0, flag=0;
for(int i=0; i<len; i++){
if(test[i]=='[' || test[i]=='(' || test[i]=='{')
{ a[ans++] = test[i]; flag = 1; }
else if( ( test[i]==']'&&a[ans-1]=='[' ) || ( test[i]=='}'&&a[ans-1]=='{' ) || ( test[i]==')'&&a[ans-1]=='(' ) )
ans--;
else if( ( test[i]==']'&&a[ans-1]!='[' ) || ( test[i]=='}'&&a[ans-1]!='{' ) || ( test[i]==')'&&a[ans-1]!='(' ) || ( (a[ans-1]==']' || a[ans-1]=='}' || a[ans-1]==')') && ans==0 ) )
{ flag=0; break; }
}
if(!ans && flag) printf("yes\n");
else printf("no\n");
}
return 0;
}