while 1:

	exps=input().split("|")

	if exps[0]=="#":break

	for i in range(len(exps)):

		v=True

		lits=exps[i][1:-1].split("&")

		for lit1 in lits:

			for lit2 in lits:

				if (lit1=="~"+lit2) or ("~"+lit1==lit2):

					v=False

		if v:

			print("yes")

			break

	else:

		print("no")

		
while 1:

	exps=input().split("|")

	if exps[0]=="#":break

	for exp in exps:

		v=1

		lit=exp[1:-1].split("&")

		for i in range(2):

			for j in range(i+1,3):

				if (lit[i]=="~"+lit[j]) or ("~"+lit[i]==lit[j]):

					v=0

		if v:

			print("yes")

			break

	else:

		print("no")

		
while 1:
    exps = input().split("|")
    if exps[0] == "#":
        break
    for i in range(len(exps)):
        v = True
        lits = exps[i][1:-1].split("&")
        for lit1 in lits:
            for lit2 in lits:
                if (lit1 == "~" + lit2) or ("~" + lit1 == lit2):
                    v = False
        if v:
            print("yes")
            break
    else:
        print("no")

while 1:
    exps = input().split("|")
    if exps[0] == "#":
        break
    for exp in exps:
        v = 1
        lit = exp[1:-1].split("&")
        for i in range(2):
            for j in range(i + 1, 3):
                if (lit[i] == "~" + lit[j]) or ("~" + lit[i] == lit[j]):
                    v = 0
        if v:
            print("yes")
            break
    else:
        print("no")

-    for i in range(len(exps)): -        v = True -        lits = exps[i][1:-1].split("&") -        for lit1 in lits: -            for lit2 in lits: -                if (lit1 == "~" + lit2) or ("~" + lit1 == lit2): -                    v = False +    for exp in exps: +        v = 1 +        lit = exp[1:-1].split("&") +        for i in range(2): +            for j in range(i + 1, 3): +                if (lit[i] == "~" + lit[j]) or ("~" + lit[i] == lit[j]): +                    v = 0