Chef has an array A of size N and an integer K. He can perform the following operation on A any number of times:
Select any K distinct indices i_{1}, i_{2}, \ldots, i_{K} and increment the array elements at these K indices by 1.  
Formally, set A_{i_{j}} := A_{i_{j}} + 1 for all 1 ≤ j ≤ K.

For example, if A = [3, 2, 8, 4, 6] and we select the indices 2, 3, 5, then A becomes [3, 2 + 1, 8 + 1, 4, 6 + 1] i.e. [3, 3, 9, 4, 7].

Determine if Chef can make the array A palindromic by applying the given operation any number of times.

Note: An array is called palindrome if it reads the same backwards and forwards, for e.g. [4, 10, 10, 4] and [7, 1, 7] are palindromic arrays.

------ Input Format ------ 

- The first line contains a single integer T — the number of test cases. Then the test cases follow.
- The first line of each test case contains two integers N and K — the size of the array A and the parameter mentioned in the statement.
- The second line of each test case contains N space-separated integers A_{1}, A_{2}, \dots, A_{N} denoting the array A.

------ Output Format ------ 

For each test case, output YES if we can make A palindromic by applying the given operation. Otherwise, output NO.

You may print each character of YES and NO in uppercase or lowercase (for example, yes, yEs, Yes will be considered identical).

------ Constraints ------ 

$1 ≤ T ≤ 10^{5}$
$1 ≤K ≤N ≤10^{5}$
$1 ≤A_{i} ≤10^{6}$
- Sum of $N$ over all test cases does not exceed $2 \cdot 10^{5}$.

----- Sample Input 1 ------ 
4
5 3
2 4 5 4 2
6 1
4 5 5 4 6 4
6 2
4 5 5 4 6 4
4 2
1 2 3 3

----- Sample Output 1 ------ 
YES
YES
YES
NO

----- explanation 1 ------ 
Test case $1$: The given array $A$ is already palindromic.

Test case $2$: We can apply the following operations:
- Select index $[4]$: $A$ becomes $[4, 5, 5, 5, 6, 4]$
- Select index $[2]$: $A$ becomes $[4, 6, 5, 5, 6, 4]$

Test case $3$: We can apply the following operations:
- Select index $[2, 4]$: $A$ becomes $[4, 6, 5, 5, 6, 4]$

Test case $4$: It can be proven that $A$ can not be converted into a palindrome using the given operations.

Difficulty: HARD
Tags: Constructive algorithms

Ad-hoc

Starter code:

Solutions:
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = input().split()
	if k == n and l[::-1] == l:
		print('YES')
	elif k == n and l[::-1] != l:
		print('NO')
	elif n % 2:
		print('YES')
	elif k % 2:
		print('YES')
	else:
		diff = 0
		for i in range(n // 2):
			d = int(l[i]) - int(l[n - 1 - i])
			if d > 0:
				diff += d
			else:
				diff -= d
		if diff % 2:
			print('NO')
		else:
			print('YES')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	d = list(map(int, input().split()))
	ans = None
	if k == 1:
		ans = 'YES'
	elif k == n and d[::-1] != d:
		ans = 'NO'
	elif n % 2 != 0 or k % 2:
		ans = 'YES'
	else:
		sums = sum(d)
		if sums % 2 == 0:
			ans = 'YES'
		else:
			ans = 'NO'
	print(ans)


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	l = list(map(int, input().split()))[:x]
	if y > x:
		print('NO')
	elif y == x:
		if l == l[::-1]:
			print('YES')
		else:
			print('NO')
	elif x % 2 == 1 or y % 2 == 1:
		print('YES')
	elif sum(l) % 2 == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if n == k:
		if arr == arr[::-1]:
			print('YES')
		else:
			print('NO')
	elif n % 2 == 1 or k % 2 == 1:
		print('YES')
	elif sum(arr) % 2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if arr == arr[::-1]:
		print('YES')
	elif k == n:
		print('NO')
	elif k % 2 == 0 and n % 2 == 0:
		if sum(arr) % 2 == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


for i in range(int(input())):
	(N, K) = list(map(int, input().split()))
	A = list(map(int, input().split()))
	if A != A[::-1]:
		if K == N:
			print('NO')
		elif K % 2 == 0 and N % 2 == 0:
			if sum(A) % 2 == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	else:
		print('YES')


def LII():
	return [int(x) for x in input().split()]
for _ in range(int(input())):
	(n, k) = LII()
	a = LII()
	assert len(a) == n
	if k == 0 or k == n:
		if any((a[i] != a[n - 1 - i] for i in range(n))):
			print('NO')
		else:
			print('YES')
		continue
	parity = sum((x % 2 for x in a))
	if n % 2 == 0 and k % 2 == 0 and (parity % 2 != 0):
		print('NO')
		continue
	print('YES')


for _ in range(int(input())):
	(N, k) = list(map(int, input().split()))
	A = list(map(int, input().split()))
	s = 0
	broken = False
	if N == k:
		for i in range(N // 2):
			if A[N - i - 1] != A[i]:
				broken = True
				break
		if not broken:
			print('YES')
		else:
			print('NO')
		continue
	if k % 2 == 1 or N % 2 == 1:
		print('YES')
		continue
	for i in range(N // 2):
		s = (s + A[N - i - 1] - A[i]) % 2
	if s % 2 == 0:
		print('YES')
	else:
		print('NO')


def ispalindrome(v):
	i = 0
	j = len(v) - 1
	while i < j:
		if v[i] != v[j]:
			return 0
		i += 1
		j -= 1
	return 1
t = int(input())
a = 1
while a <= t:
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	v = list(map(int, input().split()))
	sum = 0
	for i in range(0, n):
		sum += v[i]
	if k == n and ispalindrome(v) == False:
		print('NO')
	elif k % 2 == 0 and n % 2 == 0:
		if sum % 2 == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')
	a += 1


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split(' ')))
	ins = list(map(int, input().split(' ')))
	palen = ins[::-1]
	if ins == palen:
		print('YES')
	elif n == k:
		print('NO')
	elif (n % 2 or k % 2) or sum(ins) % 2 == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	B = A[::-1]
	if A == B:
		print('YES')
	elif K == N:
		print('NO')
	elif N % 2 or K % 2:
		print('YES')
	else:
		print('YES' if sum(A) % 2 == 0 else 'NO')


from collections import *
from math import *
from queue import *
from heapq import *
t_ = int(input())
for _ in range(t_):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	Palindrome = a == a[::-1]
	sum_arr = sum(a)
	if not Palindrome and n == k:
		print('NO')
	elif n & 1 or k & 1:
		print('YES')
	elif sum_arr & 1:
		print('NO')
	else:
		print('YES')


numTest = int(input())
for _ in range(numTest):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if arr == arr[::-1] or (n != m and (n % 2 or m % 2 or sum(arr) % 2 == 0)):
		print('YES')
	else:
		print('NO')


import sys
next((f := (map(int, s.split()) for s in sys.stdin)))
for ((n, k), (*a,)) in zip(f, f):
	print('YNEOS'[~(n | k) & 1 and sum(a) & 1 if k < n else a != a[::-1]::2])


def check(a, n):
	temp = 0
	for i in range(n // 2):
		if a[i] != a[n - i - 1]:
			temp = 1
	return temp
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k % 2 != n % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if check(a, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if check(a, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(n // 2):
			ans += abs(a[i] - a[n - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


for test in range(int(input())):
	(n, k) = map(int, input().split())
	nlist = list(map(int, input().split()))
	if k == n:
		check = True
		for i in range(n // 2):
			if nlist[i] != nlist[n - 1 - i]:
				check = False
				break
		if check == False:
			print('NO')
		else:
			print('YES')
		continue
	if k % 2 == 1 or n % 2 == 1:
		print('YES')
	else:
		diff = 0
		for i in range(n // 2):
			diff += abs(nlist[i] - nlist[n - 1 - i])
		if diff % 2 == 1:
			print('NO')
		else:
			print('YES')


def check(b, r):
	temp = 0
	for i in range(r // 2):
		if b[i] != b[r - i - 1]:
			temp = 1
	return temp
t = int(input())
for _ in range(t):
	(r, k) = map(int, input().split())
	b = list(map(int, input().split()))
	if k % 2 != r % 2:
		print('YES')
	elif k % 2 == 1:
		if k == r:
			if check(b, r) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == r:
		if check(b, r) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(r // 2):
			ans += abs(b[i] - b[r - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = a[::-1]
	if a == b:
		print('YES')
		continue
	if k == n:
		print('NO')
	elif k % 2 == 1 or n % 2 == 1:
		print('YES')
	elif sum(a) % 2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	a = [int(i) for i in input().split()]
	cnt = 0
	tmp = []
	for i in range(n // 2):
		if abs(a[i] - a[n - i - 1]) != 0:
			tmp.append(abs(a[i] - a[n - i - 1]))
	if len(tmp) == 0:
		print('YES')
	elif k == n:
		print('NO')
	elif k % 2 == 1 or n % 2 == 1:
		print('YES')
	else:
		tmp = sorted(tmp)
		if sum(tmp) % 2 == 0:
			print('YES')
		else:
			print('NO')
	t -= 1


from collections import Counter
import math

def check(a, n):
	temp = 0
	for i in range(n // 2):
		if a[i] != a[n - i - 1]:
			temp = 1
	return temp
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k % 2 != n % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if check(a, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if check(a, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(n // 2):
			ans += abs(a[i] - a[n - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


def check(arr, n):
	temp = 0
	for i in range(n // 2):
		if arr[i] != arr[n - i - 1]:
			temp = 1
	return temp
for _ in range(int(input())):
	arr = [int(x) for x in input().split()]
	(n, k) = (arr[0], arr[1])
	arr = [int(x) for x in input().split()]
	if n % 2 != k % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if check(arr, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if check(arr, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(n // 2):
			ans = ans + abs(arr[i] - arr[n - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	if arr == arr[::-1] or k == 1 or k % 2 ^ n % 2 == 1:
		print('YES')
	elif n == k:
		print('NO')
	else:
		f = True
		if k % 2 == 0:
			c = 0
			for i in range(n // 2):
				c += abs(arr[i] - arr[n - i - 1])
			if c % 2 != 0:
				f = False
		if f:
			print('YES')
		else:
			print('NO')


def correct1(sd, eb):
	tp1 = 0
	for i in range(eb // 2):
		if sd[i] != sd[eb - i - 1]:
			tp1 = 1
	return tp1

def correct2(sd, eb):
	solu = 0
	for i in range(eb // 2):
		solu += abs(sd[i] - sd[eb - i - 1])
	if solu % 2 == 0:
		print('YES')
	else:
		print('NO')
ap = int(input())
for js in range(ap):
	(eb, xx) = map(int, input().split())
	sd = list(map(int, input().split()))
	if xx % 2 != eb % 2:
		print('YES')
	elif xx % 2 == 1:
		if xx == eb:
			if correct1(sd, eb) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif xx == eb:
		if correct1(sd, eb) == 0:
			print('YES')
		else:
			print('NO')
	else:
		correct2(sd, eb)


t = int(input())
while t != 0:

	def ans(l, a):
		flag = 0
		for i in range(a // 2):
			if l[i] != l[a - i - 1]:
				flag = 1
		return flag
	(x, y) = [int(i) for i in input().split()]
	l = list(map(int, input().split()))
	if y % 2 != x % 2:
		print('YES')
	elif y % 2 == 1:
		if y == x:
			if ans(l, x) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif y == x:
		if ans(l, x) == 0:
			print('YES')
		else:
			print('NO')
	else:
		chk = 0
		for i in range(x // 2):
			chk += abs(l[i] - l[x - i - 1])
		if chk % 2 == 0:
			print('YES')
		else:
			print('NO')
	t -= 1


def pali(str1, n):
	x = 0
	for i in range(n // 2):
		if str1[i] != str1[n - i - 1]:
			x = 1
	return x
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	str1 = list(map(int, input().split()))
	if k % 2 != n % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if pali(str1, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if pali(str1, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		sol = 0
		for i in range(n // 2):
			sol += abs(str1[i] - str1[n - i - 1])
		if sol % 2 == 0:
			print('YES')
		else:
			print('NO')


def x():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if n == k:
		flag = False
		for i in range(n):
			if l[i] != l[n - i - 1]:
				flag = True
				break
		if flag:
			print('NO')
		else:
			print('YES')
		return
	if n % 2 != 0 or k % 2 != 0:
		print('YES')
		return
	rslt = 0
	for i in range(n // 2):
		rslt += abs(l[i] - l[n - i - 1])
	if rslt % 2:
		print('NO')
	else:
		print('YES')
_ = int(input())
while _:
	_ -= 1
	x()


def fun(l, n):
	temp = 0
	for i in range(n // 2):
		if l[i] != l[n - i - 1]:
			temp = 1
	return temp
for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if k % 2 != n % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if fun(l, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if fun(l, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(n // 2):
			ans += abs(l[i] - l[n - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


def f(l, n):
	for i in range(n // 2):
		if l[i] != l[-1 - i]:
			return 'NO'
	return 'YES'

def fnc(n, k):
	l = list(map(int, input().split()))
	sum = 0
	if n % 2 == 0 and k % 2 == 0:
		for i in range(n):
			sum = sum + l[i]
		if sum % 2 == 1:
			return 'NO'
	if n == k:
		return f(l, n)
	return 'YES'
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	print(fnc(n, k))


def check(a, n):
	tempuo = 0
	for i in range(n // 2):
		if a[i] != a[n - i - 1]:
			tempuo = 1
	return tempuo
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k % 2 != n % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if check(a, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if check(a, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		answer = 0
		for i in range(n // 2):
			answer += abs(a[i] - a[n - i - 1])
		if answer % 2 == 0:
			print('YES')
		else:
			print('NO')


def check(y, p):
	tep = 0
	for i in range(p // 2):
		if y[i] != y[p - i - 1]:
			tep = 1
	return tep
u = int(input())
for _ in range(u):
	(p, v) = map(int, input().split())
	y = list(map(int, input().split()))
	if v % 2 != p % 2:
		print('YES')
	elif v % 2 == 1:
		if v == p:
			if check(y, p) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif v == p:
		if check(y, p) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(p // 2):
			ans += abs(y[i] - y[p - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


def N():
	return int(input())

def A():
	return [int(x) for x in input().split()]

def S():
	return input()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def factors(n: int) -> list:
	s = set()
	step = 2 if n % 2 else 1
	for i in range(1, n ** 0.5 + 1, step):
		if n % i == 0:
			s.add(i)
			s.add(n // i)
	return factors
for _ in range(N()):
	(n, k) = A()
	if 'codechef' == 28226329:
		print('Tanmay')
	cp = n % 2
	a = A()
	ncp = s = 0
	for i in range(n // 2):
		s += abs(a[i] - a[n - i - 1])
	if n == k:
		if s == 0:
			print('YES')
		else:
			print('NO')
		continue
	if n % 2 != k % 2:
		print('YES')
		continue
	if k % 2 == 1 or (k % 2 == 0 and s % 2 == 0):
		print('YES')
		continue
	print('NO')


def check(r, m):
	temp = 0
	for i in range(m // 2):
		if r[i] != r[m - i - 1]:
			temp = 1
	return temp
n = int(input())
for _ in range(n):
	(m, x) = map(int, input().split())
	r = list(map(int, input().split()))
	if x % 2 != m % 2:
		print('YES')
	elif x % 2 == 1:
		if x == m:
			if check(r, m) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif x == m:
		if check(r, m) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(m // 2):
			ans += abs(r[i] - r[m - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


def check(x, n):
	p = 0
	for i in range(n // 2):
		if x[i] != x[n - i - 1]:
			p = 1
	return p
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	x = list(map(int, input().split()))
	if k % 2 != n % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if check(x, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if check(x, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(n // 2):
			ans += abs(x[i] - x[n - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


def toggle(a, n):
	tem = 0
	for i in range(n // 2):
		if a[i] != a[n - i - 1]:
			tem = 1
	return tem
t = int(input())
for _ in range(t):
	(number, koi) = map(int, input().split())
	ans = list(map(int, input().split()))
	if koi % 2 != number % 2:
		print('YES')
	elif koi % 2 == 1:
		if koi == number:
			if toggle(ans, number) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif koi == number:
		if toggle(ans, number) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans1 = 0
		for i in range(number // 2):
			ans1 += abs(ans[i] - ans[number - i - 1])
		if ans1 % 2 == 0:
			print('YES')
		else:
			print('NO')


def checker(a, n):
	temp = 0
	for i in range(n // 2):
		if a[i] != a[n - i - 1]:
			temp = 1
	return temp
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k % 2 != n % 2:
		print('YES')
	elif k % 2 == 1:
		if k == n:
			if checker(a, n) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif k == n:
		if checker(a, n) == 0:
			print('YES')
		else:
			print('NO')
	else:
		res = 0
		for i in range(n // 2):
			res += abs(a[i] - a[n - i - 1])
		if res % 2 == 0:
			print('YES')
		else:
			print('NO')


def check(ax, nm):
	tamps = 0
	for i in range(nm // 2):
		if ax[i] != ax[nm - i - 1]:
			tamps = 1
	return tamps

def chut():
	pass
tcz = int(input())
for _ in range(tcz):
	(nm, kj) = map(int, input().split())
	ax = list(map(int, input().split()))
	if kj % 2 != nm % 2:
		print('YES')
	elif kj % 2 == 1:
		if kj == nm:
			if check(ax, nm) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif kj == nm:
		if check(ax, nm) == 0:
			print('YES')
		else:
			print('NO')
	else:
		ans = 0
		for i in range(nm // 2):
			ans += abs(ax[i] - ax[nm - i - 1])
		if ans % 2 == 0:
			print('YES')
		else:
			print('NO')


def sotanai(fed, ff):
	tempxxx = 0
	for i in range(ff // 2):
		if fed[i] != fed[ff - i - 1]:
			tempxxx = 1
	return tempxxx
tc = eval(input())
while tc > 0:
	tc = tc - 1
	(w, j) = map(int, input().split())
	fed = list(map(int, input().split()))
	if j % 2 != w % 2:
		print('YES')
	elif j % 2 == 1:
		if j == w:
			if sotanai(fed, w) == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	elif j == w:
		if sotanai(fed, w) == 0:
			print('YES')
		else:
			print('NO')
	else:
		tikki = 0
		for i in range(w // 2):
			tikki += abs(fed[i] - fed[w - i - 1])
		if tikki % 2 == 0:
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	i = 0
	flag = 0
	while i < N:
		if A[i] == A[N - 1 - i]:
			i = i + 1
		else:
			flag = 1
			break
	if flag == 0:
		print('YES')
	elif N == K:
		print('NO')
	elif K % 2 != 0:
		print('YES')
	elif N % 2 == 1:
		print('YES')
	else:
		highest = max(A)
		total = 0
		for i in A:
			total = total + highest - i
		if (total + N) % 2 == 0:
			print('YES')
		else:
			print('NO')