#include<map>#include<stack>#include<string>#include<cstdio>#include<iostream>usingnamespacestd;
int a[1000];
bool check(string st){
map<char,int>mp;
mp['(']=0;mp[')']=1;
mp['[']=2;mp[']']=3;
mp['{']=4;mp['}']=5;
int A=0;
for (int i=0;i<st.size();i++){
if (st[i]!='('&&st[i]!=')'&&
st[i]!='['&&st[i]!=']'&&
st[i]!='{'&&st[i]!='}')continue;
a[++A]=mp[st[i]];
}
stack<int>s;
while (!s.empty())s.pop();
for (int i=1;i<=A;i++){
if (!(a[i]&1))s.push(a[i]);
else {
if (s.empty())return0;
int x=s.top(); s.pop();
if (x^a[i]!=1)return0;
}
}
return s.empty();
}
//=======cww=2016.2.29=9:12=========int main(){
string st;
while (cin>>st){
if (check(st))puts("yes");
elseputs("no");
}
return0;
}