IntermediateRating 1100
Plant the Flowers
A flowerbed is a row of 0 (empty) and 1 (planted). Flowers can't be planted next to each other. Can k more flowers be planted? Print YES or NO.
Input
n and k, then n values 0/1 (with no two 1s adjacent).
Output
YES or NO.
Sample 1
Input
5 1 1 0 0 0 1
Output
YES
Sample 2
Input
5 2 1 0 0 0 1
Output
NO
Output appears here