Buggy python submission (verdict: Time Limit Exceeded):
import collections
N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1

for key, value in A_dict.items():
    ANS=ANS*(key**value)

if ANS>10**18:
    print("-1")
else:
    print(ANS)


Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import sys
N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1

if 0 in A_dict.keys():
    print("0")
    sys.exit()
for i in A_dict.keys():
    ANS=ANS*(i**A_dict[i])

if ANS>10**18:
    print(-1)
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1

for i in A_dict.keys():
    ANS=ANS*(i**A_dict[i])

if ANS>10**18:
    print(-1)
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=list(map(int, input().split()))
A_N=np.array(A,dtype='int64')

ANS=np.prod(A_N)

if ANS>10**18:
    print(""-1")
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
for i in A_dict.keys():
    ANS=ANS*i**A_dict[i]

if ANS>10**18:
    print(-1)
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ASN=0
for i in A_dict.keys():
    ANS+=i**A_dict[i]

if ANS>10**18:
    print(-1)
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

N=int(input())
A=list(map(int, input().split()))
ANS=reduce(mul, A)

if ANS>10**18:
    print(-1)
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

N=int(input())
A=list(map(int, input().split()))
reduce(mul, A)

if ANS>10**18:
    print(-1)
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
ANS=A[0]
for i in range(1,N):
    ANS=ANS*A[i]
if ANS>10**18:
    print(-1)
else:
    print(ANS)

Fixed submission:
import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)