#include<iostream>
#include<string>
#include<stack>
#include<map>
using namespace std;
bool judge(string s) {
map<char, char> map_s = { {'(',')'},{'[',']'},{'{','}'} };
stack<char> temp;
for (int i = 0; i < s.length(); ++i) {
if (map_s.find(s[i]) != map_s.end())
temp.push(map_s[s[i]]);
else {
if (temp.empty())
return false;
if (s[i] == temp.top())
temp.pop();
else
return false;
}
}
if (temp.empty())
return true;
else
return false;
}
int main()
{
string str;
while (1)
{
getline(cin, str);
if (str.length() == 0) break;
if (judge(str)) puts("yes");
else puts("no");
}
system("pause");
return 0;
}