human
Subset Sum Problem in O ( sum ) space | .
initializing with 1 as sum 0 is always possible.
loop to go through every element of the elements array.
to change the value o all possible sum values to True.
If target is possible return True else False.
Driver code"
How can the above be solved in Python?

Write me a code to subset Sum Problem in O ( sum ) space and the other steps required?
assistant
#Here is code to subset Sum Problem in O ( sum ) space and the other steps required.
 def isPossible ( elements , target ) :
	dp = [ False ] * ( target + 1 )
	dp [ 0 ] = True
	for ele in elements :
		for j in range ( target , ele - 1 , - 1 ) :
			if dp [ j - ele ] :
				dp [ j ] = True
	return dp [ target ]
arr = [ 6 , 2 , 5 ]
target = 7
if isPossible ( arr , target ) :
	print ( " YES " )
else :
	print ( " NO " )