#!/usr/bin/env ruby
#coding: utf-8

ss = readlines[0..-2]

ss.each do |s|
  catch(:done) do
    s.chomp.split('|').each do |c|
      t = true
      cs = c[1..-2].split('&')
      cs.each do |l|
        cs.each do |_l|
          if ('~' + l == _l || l == '~' + _l)
            t = false
          end
        end
      end
      if t
        puts 'yes'
        throw(:done)
      end
    end
    puts 'no'
  end
end
  