#Solution to "Polarize" from 2025 CS@UCF Summer Camp

#We can start from the end of the Array and sweep backwards
test_count = int(input())

for _ in range(test_count):
    a = []
    target = []

    #The last k elements must be negative, since they can never be increased
    element_count, k = map(int, input().split())

    for target_element in map(int, input().split()):
        a.append(0)
        target.append(target_element)

    end_index = element_count - k

    possible = True

    #Make sure the last k elements are negative
    for endzone in range(k):
        far = element_count - endzone - 1

        #If possible, polarize this elment to match the target
        if(far - k >= 0 and target[far] < 0):
            a[far] = target[far]
            a[far - k] -= target[far]
        elif(not (target[far] == 0)):
            #If we can't change this element, the only way it's valid is if it's already 0
            possible = False


    #Sweep through both arrays backwards
    while(end_index > 1):
        end_index -= 1
        #We cannot increase this element any further, and it is not enough
        if(a[end_index] < target[end_index]):
            #Therefore, it is impossible to make the arrays match
            possible = False
        else:
            #If the target value is negative, the value in a must be decreased
            if(target[end_index] < 0):
                if(end_index - k >= 0):
                    #Simulate the polarization by increasing the target value
                    a[end_index - k] -= target[end_index]
                    target[end_index] = 0
                else:
                    possible = False

            # Now that the target value is non-negative (or "possible" is False, in which case this doesn't matter)
            # we can treat this value as if k = 1, since all value added to it could also have been added to any
            # element behind it

            #Perform a pseudo-polarization with this element and the one right behind it
            difference = a[end_index] - target[end_index]
            a[end_index - 1] += difference
            a[end_index] -= difference


    #Only the first item cannot be decreased, it is stuck with the value it is given
    if(a[0] == target[0] and possible):
        print("YES")
    else:
        print("NO")

