fun readInt () = valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn) fun quicksort [] = [] | quicksort (h::tl) = let val (s, b) = List.foldl (fn (x, (small, big)) => if x <= h then (x::small, big) else (small, x::big)) ([], []) tl in (quicksort s) @ [h] @ (quicksort b) end fun isContinuous [] = true | isContinuous [_] = true | isContinuous (h1 :: h2 :: tl) = if h1 + 1 = h2 then isContinuous (h2 :: tl) else false val () = let val a = readInt () val b = readInt () val c = readInt () val d = readInt () val sorted = quicksort [a, b, c, d] val ans = if isContinuous sorted then "Yes" else "No" in print (ans ^ "\n") end