#include<stdio.h>
#include<string.h>
#include<ctype.h>
int F(char*p)
{
	int i=0,a[3],f[3]={1,1,1};
	for(;*p;++p)
	{
		if(*p=='~')f[i]=-1;
		if(isalpha(*p))a[i++]=*p;
	}
	for(i=0;i<3;++i)a[i]*=f[i];
	return a[0]+a[1]&&a[1]+a[2]&&a[0]+a[2];
}
int main()
{
	char*p,s[512];
	while(scanf("%s",s),*s-'#')
	{
		for(p=strtok(s,"|");p;p=strtok(0,"|"))
			if(F(p)){puts("yes");goto E;}
		puts("no");
		E:;
	}
	return 0;
}