Chef has an array A consisting of N integers. He also has an intger K.
Chef wants you to find out number of different arrays he can obtain from array A by applying the following operation exactly K times.

- Pick some element in the array and multiply it by -1

As answer could be quite large, print it modulo 109 + 7.

-----Input-----
- The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
- The first line of each test case contains two space separated integers N, K as defined above.
- The second line contains N space-separated integers A1, A2, ..., AN denoting the elements of the array.

-----Output-----
- For each test case, output a single line containing an integer corresponding to the number of different arrays Chef can get modulo 109 + 7.

-----Constraints-----
- 1 ≤ T ≤ 10
- 1 ≤ N, K ≤ 105
- -106 ≤ Ai ≤ 106

-----Subtasks-----
- Subtask #1 (10 points) : N, K ≤ 10
- Subtask #2 (30 points) : N, K ≤ 100
- Subtask #3 (60 points) : N, K ≤ 105

-----Example-----
Input:
3
1 3
100
3 1
1 2 1
3 2
1 2 1

Output:
1
3
4

-----Explanation-----
Example case 1.
Chef has only one element and must apply the operation 3 times to it. After applying the operations, he will end up with -100. That is the only array he will get.

Example case 2.
Chef can apply operation to one of three elements. So, he can obtain three different arrays.

Example case 3.
Note that other than applying operation to positions (1, 2), (1, 3), (2, 3), Chef can also apply the operation twice on some element and get the original.

In summary, Chef can get following four arrays.

[1, 2, 1]
[-1, -2, 1]
[-1, 2, -1]
[1, -2, -1]

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
fact = []
fact.append(1)
for i in range(1, 100001):
	fact.append(i * fact[i - 1] % 1000000007)

def power(a, b, p):
	x = 1
	y = a
	while b > 0:
		if b % 2 == 1:
			x = x * y
			if x > p:
				x = x % p
		y = y * y
		if y > p:
			y = y % p
		b = b / 2
	return x

def inverse(N, p):
	return power(N, p - 2, p)

def combination(N, R, p):
	return fact[N] * (inverse(fact[R], p) * inverse(fact[N - R], p) % p) % p
T = int(input())
for i in range(T):
	(N, K) = [int(y) for y in input().split()]
	A = [int(arr) for arr in input().split()]
	numZ = 0
	answer = 0
	p = 1000000007
	for j in range(len(A)):
		if A[j] == 0:
			numZ = numZ + 1
	N = N - numZ
	if numZ > 0:
		if N > K:
			temp = K
			while temp >= 0:
				answer = answer + combination(N, temp, p)
				temp = temp - 1
		else:
			temp = N
			while temp >= 0:
				answer = answer + combination(N, temp, p)
				temp = temp - 1
	elif N > K:
		temp = K
		while temp >= 0:
			answer = answer + combination(N, temp, p)
			temp = temp - 2
	else:
		temp = N
		while temp >= 0:
			answer = answer + combination(N, temp, p)
			temp = temp - 2
	print(answer % 1000000007)


import math

def nCr(n, r):
	f = math.factorial
	return f(n) / f(r) / f(n - r)
t = int(input())
for i in range(0, t):
	a = input().split()
	n = int(a[0])
	k = int(a[1])
	arr = input().split()
	arr = [int(x) for x in arr]
	count = 0
	for j in arr:
		if j == 0:
			count = count + 1
	ways = 0
	if count == 0:
		if k % 2 == 0:
			l = 0
			while l <= min(n, k):
				ways = ways + nCr(n, l)
				l = l + 2
		else:
			l = 1
			while l <= min(n, k):
				ways = ways + nCr(n, l)
				l = l + 2
		print(ways)
	else:
		n = n - count
		l = 0
		while l <= min(n, k):
			ways = ways + nCr(n, l)
			l = l + 1
		print(ways)


mod = 10 ** 9 + 7
for t in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	ans = 0
	temp = 1
	limit = min(n, k) + 1
	c = a.count(0)
	if c == 0:
		x = k % 2
		for i in range(0, limit):
			if i % 2 == x:
				ans += temp
				ans %= mod
			temp = temp * (n - i) / (1 + i)
	else:
		n = n - c
		for i in range(0, limit):
			ans += temp
			ans %= mod
			temp = temp * (n - i) / (1 + i)
	print(ans)


from math import factorial
mod = 10 ** 9 + 7
mod2 = 10 ** 36
for t in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	ans = 0
	temp = 1
	limit = min(n, k) + 1
	c = a.count(0)
	if c == 0:
		x = k % 2
		for i in range(0, limit):
			if i % 2 == x:
				ans += temp
				ans %= mod
			temp = temp * (n - i) / (1 + i)
			temp %= mod2
	else:
		n = n - c
		for i in range(0, limit):
			ans += temp
			ans %= mod
			temp = temp * (n - i) / (1 + i)
			temp %= mod2
	print(ans)


from math import factorial
M = 10 ** 9 + 7
for t in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	z = a.count(0)
	if z == 0:
		s = 0
		x = factorial(n)
		for i in range(k % 2, min(n, k) + 1, 2):
			s += x / factorial(i) / factorial(n - i)
		s = s % M
		print(s)
	else:
		n = n - z
		s = 0
		x = factorial(n)
		for i in range(0, min(n, k) + 1):
			s += x / factorial(i) / factorial(n - i)
		s = s % M
		print(s)


import sys

def fun(n, x):
	res = 1
	for i in range(n, x, -1):
		res = res * i % 1000000007
	return res

def degree(a, k):
	res = 1
	cur = a
	while k:
		if k % 2:
			res = res * cur % 1000000007
		k /= 2
		cur = cur * cur % 1000000007
	return res

def inv_fun(k):
	denom = 1
	for x in range(1, k + 1, 1):
		ti = x
		while ti % 1000000007 == 0:
			ti /= 1000000007
		denom = denom * ti % 1000000007
	denom = degree(denom, 1000000005) % 1000000007
	return denom

def nCr(n, r):
	return fun(n, n - r) * inv_fun(r)
T = int(input())
for x in range(T):
	(N, K) = [int(y) for y in input().split(' ')]
	array = [int(t) for t in input().split(' ')]
	count = 0
	for i in range(len(array)):
		if array[i] == 0:
			count += 1
	K = min(N, K)
	if count != 0:
		sum = 0
		for j in range(0, min(N - count, K) + 1):
			sum += nCr(N - count, j)
	elif K % 2 == 0:
		sum = 0
		for j in range(0, K + 1, 2):
			sum += nCr(N, j)
	else:
		sum = 0
		for j in range(1, K + 1, 2):
			sum += nCr(N, j) % 1000000007
	print(sum % 1000000007)