N=int(eval(input()))

X=list(map(int, input().split()))



ans=1

if 0 in X:

    print((0))

else:

    X.sort()

    for i in X:

        ans *= i

        if 1e18<ans:

            print((-1))

            break

    else:

        print(ans)    
N=int(eval(input()))

X=list(map(int, input().split()))



ans=1

if 0 in X:

    print((0))

else:

    for i in X:

        ans *= i

        if 1e18<ans:

            print((-1))

            break

    else:

        print(ans)    
N = int(eval(input()))
X = list(map(int, input().split()))
ans = 1
if 0 in X:
    print((0))
else:
    X.sort()
    for i in X:
        ans *= i
        if 1e18 < ans:
            print((-1))
            break
    else:
        print(ans)

N = int(eval(input()))
X = list(map(int, input().split()))
ans = 1
if 0 in X:
    print((0))
else:
    for i in X:
        ans *= i
        if 1e18 < ans:
            print((-1))
            break
    else:
        print(ans)

-    X.sort()