Scanf.scanf "%d %d %d %d" (fun h w n k -> let q = (h * w) mod n in let q = if q = 0 then n else q in print_endline @@ if q = k then "YES" else "NO" )