Chef and Gift

All submissions for this problem are available.
Read problems statements in Mandarin Chinese and Russian.
Today is chef's friend's birthday. He wants to give a gift to his friend. So he was desperately searching for some gift here and there.
Fortunately, he found an array a of size n lying around. The array contains positive integers. Chef's friend likes even numbers very much. So for the gift, chef will choose a consecutive nonempty segment of the array. The segment should contain exactly k even integers. Though it can have any number of odd integers.
He will then pick that segment and gift it to his friend.
But there is a problem. It might not be always possible for the chef to choose such a segment. Please tell whether it is possible for chef to select some gift or not?
Input
First line of the input contains a single integer T denoting number of test cases.
For each test case, first line contains two space separated integers n, k.
Next line contains n space separated integers denoting content of array a.
It is also guaranteed that all the numbers in the array a are distinct.
Output
For each test case, print a single line containing "YES" or "NO" (without quotes) corresponding to the situation.
Constraints
 1 ≤ T ≤ 10
 1 ≤ n ≤ 50
 0 ≤ k ≤ n
 1 ≤ a _{i } ≤ 100
Example
Input: 4 2 1 1 2 3 2 2 6 5 3 3 2 4 5 4 2 1 2 4 5 Output: YES YES NO YES
for (int i = 0; i < n; i++)
if (i > 0) {
ans++;
} else {
ans;
}
Explanation
For first test case, we can select a[2, 2] = {2}.
For second test case, we can select a[1, 2] = {2, 6}.
For third test case, we can not select any consecutive segment having exactly 3 even numbers.
For fourth test case, we can select a[2, 3] = {2, 4}.
Note
A consecutive non empty segment of array a is a segment a[l], a[l + 1] , , a[r] such that 1 ≤ l ≤ r ≤ n.
Author:  dpraveen 
Editorial  http://discuss.codechef.com/problems/PRGIFT 
Tags  adhoc aug14 cakewalk dpraveen 
Date Added:  15072014 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP 4.9.2, JAVA 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 
why k==0 is a special case
cant we take all i/p 1st and
@sneha it dosent matters
For which test case my code
Hey what is the problem with
do the k even numbers should
Can anyone please explain me
LOL !! He found an array of
#include void main() { int
give the link to ur code i
please explain what is wrong
tricky one nice one
I wonder, why some questions
The corner case caught my
i hate that boundary
k=0 means we can not pick any
he found an array lying there