n = int(eval(input()))

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

if 0 in a:

  print((0))

else :

  prod = 1

  for x in a:

    prod *= x

    if prod:

      if prod > 10**18:

        print((-1))

        break

    else :

      print((0))

      break

  else :

    print(prod)

n = int(eval(input()))

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

if 0 in a:

  print((0))

else :

  prod = 1

  for x in a:

    prod *= x

    if prod > 10**18:

      print((-1))

      break

  else :

    print(prod)
n = int(eval(input()))
a = list(map(int, input().split()))
if 0 in a:
    print((0))
else:
    prod = 1
    for x in a:
        prod *= x
        if prod:
            if prod > 10**18:
                print((-1))
                break
        else:
            print((0))
            break
    else:
        print(prod)

n = int(eval(input()))
a = list(map(int, input().split()))
if 0 in a:
    print((0))
else:
    prod = 1
    for x in a:
        prod *= x
        if prod > 10**18:
            print((-1))
            break
    else:
        print(prod)

-        if prod: -            if prod > 10**18: -                print((-1)) -                break -        else: -            print((0)) +        if prod > 10**18: +            print((-1))