if arr !! index > box1 then
solve arr (index + 1) (arr !! index, box2)
else

の部分では、box1>box2 なのでどちらの分岐も考えられる
出力の型をBoolに変更し

if arr !! index > box1 then
solve arr (index + 1) (arr !! index, box2) || solve arr (index + 1) (arr !! index, box2)
else

でどうでしょう。で後からTrue,FalseをYES,NOに変えればOK 👀
Rock54: Caution(BBR-MD5:0be15ced7fbdb9fdb4d0ce1929c1b82f)