N = int(eval(input()))

A = [int(x) for x in input().split()]



reg = A[0]

flg=True

if 0 in A:

    print((0))

    flg=False

    reg=0

for i in range(1, N):

    reg *= A[i]

    if reg>10**18:

        print((-1))

        flg=False

        break

if flg:

    print(reg)
def ABC_169_B():

    N=int(eval(input()))

    A = input().split()

    A = [int(s) for s in A]

    sum=1

    flg=0



    if A.count(0)>=1:

        print((0))

        flg=1



    if flg==0:

     for i in range(len(A)):

         sum=(sum*A[i])

         if sum>10**18:

             print((-1))

             flg=1

             break

    if flg==0:

        print(sum)

        

if __name__ == '__main__':



    ABC_169_B()
N = int(eval(input()))
A = [int(x) for x in input().split()]
reg = A[0]
flg = True
if 0 in A:
    print((0))
    flg = False
    reg = 0
for i in range(1, N):
    reg *= A[i]
    if reg > 10**18:
        print((-1))
        flg = False
        break
if flg:
    print(reg)

def ABC_169_B():
    N = int(eval(input()))
    A = input().split()
    A = [int(s) for s in A]
    sum = 1
    flg = 0
    if A.count(0) >= 1:
        print((0))
        flg = 1
    if flg == 0:
        for i in range(len(A)):
            sum = sum * A[i]
            if sum > 10**18:
                print((-1))
                flg = 1
                break
    if flg == 0:
        print(sum)


if __name__ == "__main__":
    ABC_169_B()

-N = int(eval(input())) -A = [int(x) for x in input().split()] -reg = A[0] -flg = True -if 0 in A: -    print((0)) -    flg = False -    reg = 0 -for i in range(1, N): -    reg *= A[i] -    if reg > 10**18: -        print((-1)) -        flg = False -        break -if flg: -    print(reg) +def ABC_169_B(): +    N = int(eval(input())) +    A = input().split() +    A = [int(s) for s in A] +    sum = 1 +    flg = 0 +    if A.count(0) >= 1: +        print((0)) +        flg = 1 +    if flg == 0: +        for i in range(len(A)): +            sum = sum * A[i] +            if sum > 10**18: +                print((-1)) +                flg = 1 +                break +    if flg == 0: +        print(sum) + + +if __name__ == "__main__": +    ABC_169_B()