Scanf.scanf "%d %d %s" (fun a b s ->
    let rec loop i =
        if i = a + b + 1 then true else
        if i = a then (if s.[i] = '-' then loop (i + 1) else false) else
            if s.[i] >= '0' && s.[i] <= '9' then loop (i + 1) else false
    in
    print_endline @@ if loop 0 then "Yes" else "No"
)