import scala.annotation.tailrec
object Main extends App {

  import scala.io.StdIn._

  solve
  def solve: Unit = {
    val exp = readLine.trim
    if (exp == "#") return
    println(
      if (Expression.canBeTrue(exp)) "yes" else "no"
    )
    solve
  }
  object Expression {
    def canBeTrue(expression: String): Boolean = parseAll(expression.toList)
    @tailrec
    private def parseAll(arg: List[Char]): Boolean = {
      arg match {
        case b Clause _ if b ⇒ true
        case _ Clause '|'::t ⇒ parseAll(t)
        case _ ⇒ false
      }
    }
  }
  object Clause {
    def unapply(arg: List[Char]): Option[(Boolean, List[Char])] = {
      arg match {
        case '('::(a Variable '&'::(b Variable '&'::(c Variable ')'::t))) ⇒ Some(a.canCoexistence(b) && b.canCoexistence(c) && c.canCoexistence(a), t)
        case _ ⇒ None
      }
    }
  }
  object Variable{
    def unapply(arg: List[Char]): Option[(Variable, List[Char])] = {
      arg match {
        case '~'::c::t ⇒ Some(Inverse(c), t)
        case c::t if c.isLetter ⇒ Some(Straight(c), t)
        case _ ⇒ None
      }
    }
  }
  sealed trait Variable {
    def canCoexistence(that: Variable): Boolean
  }
  case class Straight(char: Char) extends Variable {
    override def canCoexistence(that: Variable): Boolean = {
      that match {
        case Inverse(c) ⇒ c != char
        case _ ⇒ true
      }
    }
  }
  case class Inverse(char: Char) extends Variable {
    override def canCoexistence(that: Variable): Boolean = {
      that match {
        case Straight(c) ⇒ c != char
        case _ ⇒ true
      }
    }
  }
  implicit class Extension[T](val value :T) extends AnyVal {
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}
