#include<bits/stdc++.h> using namespace std; string s; stack<char>st; int main(){ cin>>s; for(int i=0;i<s.size();i++){ if(s[i]==')'){ if(st.empty()||st.top()!='('){ cout<<"no"; return 0; } } else if(s[i]==']'){ if(st.empty()||st.top()!='['){ cout<<"no"; return 0; } } else if(s[i]=='}'){ if(st.empty()||st.top()!='{'){ cout<<"no"; return 0; } } st.push(s[i]); } if(st.!empty())cout<<"no"; else cout<<"yes"; return 0; } /************************************************************** Problem: 1486 User: chenshuo Language: C++ Result: Compile Error ****************************************************************/