### main

loop do
  exp = gets.strip
  break if exp == '#'

  cls = exp.split('|').map{|cl| cl.delete('()').split('&')}
  #p cls

  result = false

  for cl in cls
    clok = true

    for i in (0..1)
      ci = cl[i]
      for j in ((i + 1)..2)
        cj = cl[j]
        if ci == '~' + cj || cj == '~' + ci
          clok = false
          break
        end
      end
      break if ! clok
    end

    if clok
      result = true
      break
    end
  end

  puts (result ? 'yes' : 'no')
end