#include <iostream>
#include <vector>
#include <string>

#define rep(i,n)  for(int i=0;i<n;++i)

using namespace std;

struct lit
{
	char c;
	bool is_not;
};

struct clause
{
	lit l[3];
};

typedef vector<clause> expr;

string text;
int p;

bool end() { return p >= text.length(); }
char peek() { return text[p]; }
void succ() { if (!end()) p++; }

lit parse_literal()
{
	lit l = { 0, false };
	if (peek() == '~')
	{
		succ();
		l.is_not = true;
	}
	l.c = peek();
	succ();
	return l;
}

clause parse_clause()
{
	clause c;
	if (peek() == '(') succ();
	rep(i,3)
	{
		if (i != 0 && peek() == '&') succ();
		c.l[i] = parse_literal();
	}
	if (peek() == ')') succ();
	return c;
}

expr parse_expr()
{
	p = 0;

	expr e;
	e.push_back(parse_clause());
	while (!end() && peek() == '|')
	{
		succ();
		e.push_back(parse_clause());
	}
	return e;
}

bool sat_clause(clause c)
{
	char decision[128] = { 0 };
	rep(i,3)
	{
		char v = c.l[i].c;
		char tf = c.l[i].is_not ? -1 : 1;
		if (!decision[v]) decision[v] = tf;
		else if (decision[v] != tf) return false;
	}
	return true;
}

bool sat(expr e)
{
	rep(i,e.size())
	{
		if (sat_clause(e[i])) return true;
	}
	return false;
}

int main()
{
	while(cin>>text, text != "#")
	{
		expr e = parse_expr();
		cout << (sat(e) ? "yes" : "no") << endl;
	}
	return 0;
}