Scanf.scanf "%d" (fun n ->
    let digit_sum d =
        let rec loop r acc =
            if r = 0 then acc else loop (r / 10) (acc + r mod 10)
        in
        loop d 0
    in
    print_endline @@ if n mod digit_sum n = 0 then "Yes" else "No"
)