#include<iostream>
#include<string>
using namespace std;
string S;
bool search(string F) {
	string U[3]; F += '&'; string G = ""; int cnt = 0;
	for (int i = 0; i<F.size(); i++) {
		if (F[i] == '&') { U[cnt] = G; cnt++; G = ""; }
		else G += F[i];
	}
	if (U[0].size() == 1 && U[1].size() == 2 && U[0][0] == U[1][1])return false;
	if (U[0].size() == 1 && U[2].size() == 2 && U[0][0] == U[2][1])return false;
	if (U[1].size() == 1 && U[2].size() == 2 && U[1][0] == U[2][1])return false;
	if (U[0].size() == 2 && U[1].size() == 1 && U[0][1] == U[1][0])return false;
	if (U[0].size() == 2 && U[2].size() == 1 && U[0][1] == U[2][0])return false;
	if (U[1].size() == 2 && U[2].size() == 1 && U[1][1] == U[2][0])return false;
	return true;
}
int main() {
	while (true) {
		cin >> S; if (S == "#")break;
		S += '|'; string T = ""; bool OK = false;
		for (int i = 0; i<S.size(); i++) {
			if (S[i] == '|') { if (search(T) == true)OK = true; T = ""; }
			if (S[i] != '|' && S[i] != '(' && S[i] != ')')T += S[i];
		}
		if (OK == true)cout << "yes" << endl;
		else cout << "no" << endl;
	}
	return 0;
}