#include <stdio.h>
#define SIZE 100

int sp;
char st[SIZE];

void push(char ch);
char pop();
int empty();
int underflow();
int overflow();
void clear();

int main(int argc, const char *argv[])
{
	int flag = 0;
	char tmp, ch;

	while((ch = getchar()) != EOF)
	{
		if(ch == '.')
		{
			if(flag)
			{
				printf("no\n");
			}
			else if(!empty())
			{
				printf("no\n");
			}
			else
			{
				printf("yes\n");
			}

			flag = 0;
			clear();
		}
		else if(ch == '(' || ch == '[')
		{
			push(ch);
		}
		else if(ch == ')')
		{
			if(underflow())
			{
				flag = 1;
			}
			else if((tmp = pop()) != '(')
			{
				flag = 1;
			}
		}
		else if(ch == ']')
		{
			if(underflow())
			{
				flag = 1;
			}
			else if((tmp = pop()) != '[')
			{
				flag = 1;
			}
		}
		else
		{
			continue;
		}
	}

	return 0;
}

void push(char ch)
{
	st[++sp] = ch;
}

char pop()
{
	char res = st[sp--];
	return res;
}

int empty()
{
	return sp == 0;
}

int underflow()
{
	return sp < 0;
}

int overflow()
{
	return sp >= SIZE;
}

void clear()
{
	sp = 0;	
}