Array sum = 0 in python

You are given an array of size N, consisting only of -1 and 1.Your task is to make the sum of the array equals 0. To make the sum 0, you can do ‘one’ of the following operation in each step.

Also, you will see that it’s not always possible to make the sum 0, if it’s impossible to make the sum 0, print −1 as a result.

The array will only contain −1 and +1 as the elements.

ANSWER MUST BE IN PYTHON

//Run you code here