#include<bits/stdc++.h>
#include<string>
using namespace std;
int main(){
int flag=1;
stack<char> s;
stack<char,vector<char> > stk;
string str;
getline(cin,str);
for(int i=0;i<str.size();i++){
if(str[i]=='{'||str[i]=='['||str[i]=='('){
s.push(str[i]);
}
else if(str[i]=='}'){
if(!s.empty()){
if(s.top()!='{'){
cout<<"no";
flag=0;
break;
}
else s.pop();
}
else{
flag=0;
break;
}
}
else if(str[i]==']'){
if(!s.empty()) {
if(s.top()!='['){
cout<<"no";
flag=0;
break;
}
else s.pop();
}
else{
flag=0;
break;
}
}
else if(str[i]==')'){
if(!s.empty()) {
if(s.top()!='('){
cout<<"no";
flag=0;
break;
}
else s.pop();
}
else{
flag=0;
break;
}
}
}
if(flag==1){
if(s.empty()) cout<<"yes";
else cout<<"no";
}
return 0;
}
