Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")

else:
    for i in range(N):
        a *= An[i]
    if a <= 10**18:
        print(a)
    else:
        print("-1")

Fixed submission:
import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import mul
N = int(input())
An = input().split()
An_int = list(map(int, An))
AnS = reduce(mul,An_int)

if AnS <= 10**18:
    print(AnS)
else:
    print("-1")

Fixed submission:
import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import mul
N = int(input())
An = input().split()
An_int = list(map(int, An))
AnS = reduce(mul,An_int)
if AnS <= 10**18:
    print(AnS)
else:
    print("-1")


Fixed submission:
import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import mul
N = int(input())
An = input().split()
Ani = [int(i) for i in An]
AnS = reduce(mul,Ani)
if AnS <= 10**18:
    print(AnS)
else:
    print("-1")


Fixed submission:
import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import mul
N = int(input())
An = input().split()
for i in range(N):
    An[i] = int(An[i])
AnS = reduce(mul,An)
if AnS <= 10**18:
    print(AnS)
else:
    print("-1")


Fixed submission:
import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()

Buggy python submission (verdict: Runtime Error):
import numpy
N = input()
An = input().split()
AnS = numpy.prod(An)
print(AnS)


Fixed submission:
import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()