#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;
}