human
Check if sum of the given array can be reduced to 0 by reducing array elements by K | Function to check if the sum can be made 0 or not.
Stores sum of array elements.
Traverse the array.
Driver Code.
Given array arr [ ]"
Solution in Python:

Can you provide a code to check if sum of the given array can be reduced to 0 by reducing array elements by K and the other steps required?
assistant
#Here is code to check if sum of the given array can be reduced to 0 by reducing array elements by K and the other steps required.
 def sumzero ( arr , N , K ) :
	sum = 0 ;
	for i in range ( N ) :
		sum += arr [ i ] ;
	if ( sum == 0 ) :
		print ( " Yes " ) ;
	elif ( sum > 0 ) :
		if ( sum % K == 0 ) :
			print ( " Yes " ) ;
		else :
			print ( " No " ) ;
	else :
		print ( " No " ) ;
if __name__ == " _ _ main _ _ " :
	arr1 = [ 1 , - 6 , 2 , 2 ] ;
	K = 1 ;
	N = len ( arr1 ) ;
	sumzero ( arr1 , N , K ) ;