Write a Python program to determine the number of elements in a given array before the return value is -1.
Array = [2, 3, -1, 5, 4, 7]
def countElements(Array): 
    count = 0
    for i in Array: 
        if i != -1: 
            count = count + 1
        else: 
            break
    return count