#include <bits/stdc++.h>
using namespace std;
string s;
unordered_map<char,char> mp;
void init()
{
mp[')']='(';
mp[']']='[';
mp['}']='{';
}
bool check(string s)
{
stack<char> stk;
for(int i=0;i<s.size();i++)
{
if(s[i]=='('||s[i]=='{'||s[i]=='[')
stk.push(s[i]);
else
{
if(stk.size())
{
if(mp[s[i]]==stk.top())
{
stk.pop();
}
else return false;
}
else
{
return false;
}
}
}
if(stk.size()) return false;
return true;
}
int main()
{
init();
while(cin>>s)
{
if(check(s))
{
puts("yes");
}
else puts("no");
}
return 0;
}