#include#include using namespace std; int main() { char a[51],b[51]; int i,top; while(gets(a)!=NULL) { top=-1; for(i=0;a[i]!='\0';i++) { if(a[i]=='{'||a[i]=='['||a[i]=='(') { b[++top]=a[i]; } else if(a[i]=='}') { if(b[top]=='{') { top--; } else { break; } } else if(a[i]==']') { if(b[top]=='[') { top--; } else { break; } } else if(a[i]==')') { if(b[top]=='(') { top--; } else { break; } } } if(top==-1 && a[i]=='\0') cout<<"yes"<