First off, I do not think you mean the standard combinatorial definition of derangement as found here: http://en.wikipedia.org/wiki/Derangement as this requires that each item has its own "home" let's say. I'm going to solve this assuming that you mean arrangement instead.
We can solve the problem by creating one "super" subsequence of zeroes
having length $K$. Then we can think of now having $M$ ones still but $N-M-K+1$ zeroes as a result of the combination. In total we now have $N-K+1$ items to arrange in sequences. Before combining there were $\binom{N}{M}$ different sequences and after combining there are $\binom{N-K+1}{M}$ sequences with at least $K$ consecutive zeroes. Thus the probability you seek is: $$p(K) = \frac{\binom{N-K+1}{M}}{\binom{N}{M}} ; \ K=1,2,...,N-M$$
A quick sanity check at the endpoints of $K$ shows that we get what intuition or a quick sketch would confirm. For $K =1$ we know that the probability should be $1$ which the above formula $\frac{\binom{N}{M}}{\binom{N}{M}}$ gives. Also for $K = N-M$ we can see that there are $M+1$ positions for our "super" subsequence to occupy in the following diagram:
$$(\underbrace{000\cdots0}_{N-M} \underbrace{111\cdots1}_{M})$$
If you think of the rightmost $0$ in the "super" subsequence and the positions it can occupy, you will see that there are $M+1$ possible subseqences when $K = N-M$. And so the probability agrees with our formula: $$\frac{\binom{M+1}{M}}{\binom{N}{M}} = \frac{M+1}{\binom{N}{M}}$$.