n=int(eval(input()))

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

num=1

if l.count(0)!=0:

    print((0))

else:

    flag=True

    for i in l:

        if num>10**18:

            print((-1))

            flag=False

            break

        else:

            num*=i

    if flag==True:

        if num>10**18:

            print((-1))

        else:

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

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

if l.count(0)!=0:

  print((0))

else:

  num=1

  for i in l:

    if num>10**18:

      break

    else:

      num*=i

  if num>10**18:

    print((-1))

  else:

    print(num)
n = int(eval(input()))
l = list(map(int, input().split()))
num = 1
if l.count(0) != 0:
    print((0))
else:
    flag = True
    for i in l:
        if num > 10**18:
            print((-1))
            flag = False
            break
        else:
            num *= i
    if flag == True:
        if num > 10**18:
            print((-1))
        else:
            print(num)

n = int(eval(input()))
l = list(map(int, input().split()))
if l.count(0) != 0:
    print((0))
else:
    num = 1
    for i in l:
        if num > 10**18:
            break
        else:
            num *= i
    if num > 10**18:
        print((-1))
    else:
        print(num)

-num = 1 -    flag = True +    num = 1 -            print((-1)) -            flag = False -    if flag == True: -        if num > 10**18: -            print((-1)) -        else: -            print(num) +    if num > 10**18: +        print((-1)) +    else: +        print(num)