#include <iostream>
#include <stack>
using namespace std;
int main() {
string s;
cin>>s;
stack<char>st;
bool flag=true;
for(int i=0; i<s.size(); i++){
if(s[i]=='[' or s[i]=='(' or s[i]=='{')
st.push(s[i]);
else if(!st.empty()){
if (s[i]==']' && st.top()=='[') st.pop();
else if (s[i]==')' && st.top()=='(') st.pop();
else if (s[i]=='}' && st.top()=='{') st.pop();
else flag=false;
} else flag=false;
}
if(st.empty() && flag) cout<<"yes\n";
else cout<<"no\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RhY2s+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXN0cmluZyBzOwoJY2luPj5zOwoJc3RhY2s8Y2hhcj5zdDsKCWJvb2wgZmxhZz10cnVlOwoJZm9yKGludCBpPTA7IGk8cy5zaXplKCk7IGkrKyl7CgkJaWYoc1tpXT09J1snIG9yIHNbaV09PScoJyBvciBzW2ldPT0neycpCgkJCXN0LnB1c2goc1tpXSk7CgkJZWxzZSBpZighc3QuZW1wdHkoKSl7CgkJCWlmIChzW2ldPT0nXScgJiYgc3QudG9wKCk9PSdbJykgc3QucG9wKCk7CgkJCWVsc2UgaWYgKHNbaV09PScpJyAmJiBzdC50b3AoKT09JygnKSBzdC5wb3AoKTsKCQkJZWxzZSBpZiAoc1tpXT09J30nICYmIHN0LnRvcCgpPT0neycpIHN0LnBvcCgpOwoJCQllbHNlIGZsYWc9ZmFsc2U7CgkJfSBlbHNlIGZsYWc9ZmFsc2U7Cgl9CglpZihzdC5lbXB0eSgpICYmIGZsYWcpIGNvdXQ8PCJ5ZXNcbiI7CgllbHNlIGNvdXQ8PCJub1xuIjsKCXJldHVybiAwOwp9