Solve #61 in Haskell.