loop do
  s = gets.chomp
  break if s == '.'
  loop do
    slen = s.length
    s.gsub!(/\[([^\(\)\[\]])*\]/, '')
    s.gsub!(/\(([^\(\)\[\]])*\)/, '')
    break if slen == s.length
  end
  if ['(', ')', '[', ']'].any?{ |c| s.include?(c) }
    puts 'no'
  else puts 'yes'
  end
end