#include <cstdio>
#include <cstring>
#include <cctype>
using namespace std;

const int MAX_L = 500;

char buf[MAX_L + 1];
int stat[0x100];

bool init(){
	scanf("%[^\n]%*c", buf);
	return strcmp(buf, "#");
}

bool solve(){
	const int L = strlen(buf);
	char cs[3];
	for(int i=0, k=0; i<L; i++){
		if(buf[i] == '('){
			memset(stat, 0, sizeof(stat));
			k = 0;
		}
		else if(buf[i] == '~'){
			char ch = buf[++i];
			cs[k++] = ch;
			stat[ch] |= 2;
		}
		else if(isalpha(buf[i])){
			char ch = buf[i];
			cs[k++] = ch;
			stat[ch] |= 1;
		}
		else if(buf[i] == ')'){
			if(stat[cs[0]] != 3 && stat[cs[1]] != 3 && stat[cs[2]] != 3){
				return true;
			}
		}
	}

	return false;
}

int main(){
	while(init()){
		puts(solve() ? "yes" : "no");
	}

	return 0;
}