f n xs = take ((length xs)-n+1) [take n x | x <- tails xs]

f n xs = filter ((==n).length) [take n x | x <- tails xs]