num = gets.chomp.split num.map!{|n| n.to_i} if num[1] % num[0] != 0 puts "NO" else puts num[1] / num[0] end