n=int(eval(input()))

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

ans = 1

if a.count(0)>0:

    print((0))

    exit()

for i in range(n):

    l = len(str(ans))

    L = len(str(a[i]))

    if a[i] > 10**18:

        print((-1))

        exit()

    elif l+L > 20:

        print((-1))

        exit()

    ans *= a[i]

    if ans > 10**18:

        print((-1))

        exit()

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

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

if 0 in l:

  print((0))

  exit()

ans = 1

for i in l:

  ans *= i

  if ans > 10**18:

    print((-1))

    exit()

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
if a.count(0) > 0:
    print((0))
    exit()
for i in range(n):
    l = len(str(ans))
    L = len(str(a[i]))
    if a[i] > 10**18:
        print((-1))
        exit()
    elif l + L > 20:
        print((-1))
        exit()
    ans *= a[i]
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

n = int(eval(input()))
l = list(map(int, input().split()))
if 0 in l:
    print((0))
    exit()
ans = 1
for i in l:
    ans *= i
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

-a = list(map(int, input().split())) -ans = 1 -if a.count(0) > 0: +l = list(map(int, input().split())) +if 0 in l: -for i in range(n): -    l = len(str(ans)) -    L = len(str(a[i])) -    if a[i] > 10**18: -        print((-1)) -        exit() -    elif l + L > 20: -        print((-1)) -        exit() -    ans *= a[i] +ans = 1 +for i in l: +    ans *= i