#include <cstdio>
#include <cstring>

using namespace std;

int main()
{
	char s[1024];
	
	while (scanf("%s", s) && s[0] != '#'){
		int p[3], q[3] = {0, 0, 0};
		int ctr = 0;
		
		for (int i = 0; s[i]; i++){
			if (ctr == 3){
				if (!((p[0] == p[1] && q[0] != q[1]) ||
					  (p[0] == p[2] && q[0] != q[2]) ||
					  (p[1] == p[2] && q[1] != q[2]))){
					  	printf("yes\n");
						goto end;
					}
				memset(p, 0, sizeof(p));
				memset(q, 0, sizeof(q));
				ctr = 0;
			}
			if (s[i] == '(' || s[i] == ')' || s[i] == '&' || s[i] == '|') continue;
			if (s[i] == '~') q[ctr] = 1;
			else p[ctr++] = s[i];
		}
		printf("no\n");
		end:;
	}
	
	return (0);
}