#include <bits/stdc++.h> 
using namespace std; 

string s;
//检验是否匹配 
bool check(){
	stack<char> p;//定义能够存储char的栈
	p.push('#');//先存一个#,避免空栈判断
	
	for(int i = 0;i < s.size();i++){
		char c = s[i];
		if(c == ')'){
			if(p.top() != '(')
			   return false;
			else
			   p.pop();
		}else if(c == ']'){
			if(p.top() != '[')
			   return false;
			else 
			   p.pop();
		}else{
			p.push(c);
		}
	}
	
	return (p.size() == 1);
} 

int main(){ 
	cin>>s;
	if(check()){
		cout<<"yes"<<endl;
	}else{
		cout<<"no"<<endl;
	}
	return 0; 
} 

/**************************************************************
	Problem: 1486
	User: admin
	Language: C++
	Result: Accepted
	Time:47 ms
	Memory:2080 kb
****************************************************************/