let coin = [500; 100; 50; 10; 5; 1] |> List.map (fun x -> x, (Scanf.scanf " %d" (fun x -> x)));; let s = Scanf.scanf " %d" (fun x -> x);; let s = List.fold_left (fun s (x, y) -> let z = min y (s / x) in s - z*x) s coin;; if s = 0 then print_endline "YES" else print_endline "NO";;