# 4949
while True:
			sentence = str(input())
			stack = []
			if sentence == '.':
					print('yes')
					break
			else:
				for i in sentence:
					if i == '[' or i == '(':
						stack.append(i)
					elif i == ']':
						if stack[-1] == '[':
							stack.pop()
						else:
							print('no')
							break
					elif i == ')':
						if stack[-1] == '(':
							stack.pop()
						else:
							print('no')
							break
				else:
					if not stack: #break되지 않고 스택이 비어있는 상황
						print('yes')
					else:
						print('no')					