A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But the problem is, the system is not perfect and sometimes it happens that Geraldionians cannot express a certain sum of money with any set of banknotes. Of course, they can use any number of banknotes of each value. Such sum is called unfortunate. Gerald wondered: what is the minimum unfortunate sum?


-----Input-----

The first line contains number n (1 ≤ n ≤ 1000) — the number of values of the banknotes that used in Geraldion. 

The second line contains n distinct space-separated numbers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^6) — the values of the banknotes.


-----Output-----

Print a single line — the minimum unfortunate sum. If there are no unfortunate sums, print  - 1.


-----Examples-----
Input
5
1 2 3 4 5

Output
-1

Source: codeforces | Difficulty: EASY
Tags: Sorting

Implementation


Solutions:
n = int(input())
a = [int(i) for i in input().split()]
if a.count(1) > 0:
	print(-1)
else:
	print(1)


n = int(input())
a = [int(i) for i in input().split()]
x = 0
for i in range(n):
	if a[i] < 2:
		x = 1
		break
if x:
	print(-1)
else:
	print(1)


n = int(input())
l = list(map(int, input().split(' ')))
if l.count(1) > 0:
	print('-1')
else:
	print('1')


a = (input(), print('-1' if '1' in input().split() else 1))


from sys import stdin, stdout
input = stdin.readline
n = int(input())
s = input().split()
if '1' in s:
	stdout.write('-1')
else:
	stdout.write('1')


n = int(input())
l = list(map(int, input().split()))
if 1 in l:
	print(-1)
else:
	print(1)


n = input()
if '1' in input().split():
	print('-1')
else:
	print(1)


def main():
	n = int(input())
	a = set(list(map(int, input().split(' '))))
	if 1 in a:
		return '-1'
	return '1'
print(main())


def __starting_point():
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	if a[0] == 1:
		print(-1)
	else:
		print(1)
__starting_point()


n = int(input())
a = [int(x) for x in input().split()]
if min(a) == 1:
	print(-1)
else:
	print(1)


a = int(input())
s = input().split()
for i in range(a):
	s[i] = int(s[i])
if 1 in s:
	print(-1)
else:
	print(1)


n = int(input())
l = input().split()
for i in range(n):
	l[i] = int(l[i])
if l.count(1) == 0:
	print(1)
else:
	print(-1)


input()
print(-1 if min(list(map(int, str.split(input())))) == 1 else 1)


n = input()
m = min(map(int, input().split()))
print(-1 if m == 1 else 1)


input()
print([1, -1][sorted(map(int, input().split()))[0] == 1])


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
from fractions import *

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
a = sorted(array())
if a[0] == 1:
	print(-1)
else:
	print(1)


import math
import itertools
import os
import sys
n = int(input())
A = sorted(map(int, input().split()))
if A[0] == 1:
	print('-1')
else:
	print('1')


from math import ceil

def mp():
	return map(int, input().split())

def lt():
	return list(map(int, input().split()))

def pt(x):
	print(x)

def ip():
	return input()

def it():
	return int(input())

def sl(x):
	return [t for t in x]

def spl(x):
	return x.split()

def aj(liste, item):
	liste.append(item)

def bin(x):
	return '{0:b}'.format(x)

def listring(l):
	return ' '.join([str(x) for x in l])

def printlist(l):
	print(' '.join([str(x) for x in l]))

class Stack(object):

	def __init__(self):
		self.items = []

	def push(self, new):
		self.items.append(new)

	def pop(self):
		return self.items.pop()

	def empty(self):
		return self.items == []
n = it()
a = lt()
if 1 in a:
	print(-1)
else:
	print(1)


n = int(input())
arr = list(map(int, input().split()))[:n]
c = min(arr) - 1
if c == 0:
	print(-1)
else:
	print(1)


n = int(input())
l = list(map(int, input().strip().split()[:n]))
if min(l) != 1:
	print(1)
else:
	print(-1)


import math
n = int(input())
a = list(map(int, input().split()))
if a.count(1) != 0:
	print(-1)
else:
	print(1)


def __starting_point():
	n = int(input())
	data = list(map(int, input().split()))
	if 1 in data:
		print('-1')
	else:
		print(1)
__starting_point()


N = int(input())
arr = [int(i) for i in input().split(' ')][:N]
arr.sort()
if arr[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
curr = input().strip().split(' ')
curr = [int(x) for x in curr]
if 1 in curr:
	print(-1)
else:
	print(1)


n = int(input())
a = list(map(int, input().split()))
m = min(a)
if m == 1:
	print(-1)
else:
	print(1)


x = int(input())
y = [int(a) for a in input().split()]
if 1 in y:
	print(-1)
else:
	print(1)


n = int(input())
A = list(map(int, input().split()))
if min(A) - 1 <= 0:
	print(-1)
else:
	print(1)


n = int(input())
a = map(int, input().split())
a = list(a)
a.sort()
print(-1 if a[0] == 1 else 1)


d = input()
d = int(d)
st1 = input()
notes = [int(i) for i in st1.split(' ')]

def unfortunate_sum(notes):
	if 1 in notes:
		print(-1)
		return
	else:
		print(1)
		return
unfortunate_sum(notes)


n = int(input())
notes = list(map(int, input().split()))
print((1, -1)[min(notes) == 1])


n = int(input())
a = map(int, input().split())
if 1 in a:
	print(-1)
else:
	print(1)


n = int(input())
lst = [int(x) for x in input().split()]
lst = sorted(lst)
if lst[0] == 1:
	print(-1)
else:
	print(1)


a = int(input())
b = [int(x) for x in input().split()]
flag = 0
for i in b:
	if i == 1:
		flag = 1
		break
if flag:
	print('-1')
else:
	print('1')


n = int(input())
al = list(map(int, input().split()))
print('-1' if min(al) == 1 else '1')


def unfortunate(arr):
	if 1 in arr:
		return -1
	else:
		return 1
n = int(input())
arr = list(map(int, input().split()))
print(unfortunate(arr))


from sys import stdin
n = int(stdin.readline())
nums = list(map(int, stdin.readline().rstrip().split(' ')))
nums.sort()
if nums[0] == 1:
	print(-1)
else:
	print(1)


N = int(input())
N = list(map(int, input().split()))
if 1 in N:
	print(-1)
else:
	print(1)


__author__ = 'artyom'

def main():
	n = read()
	mn = 1000001
	for v in read(3):
		if v < mn:
			mn = v
	return -1 if mn == 1 else 1

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


n = int(input())
arr = list(map(int, input().strip().split()))
arr = sorted(arr)
if arr[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
li = list(map(int, input().split()))
if 1 in li:
	print(-1)
else:
	print(1)


a = int(input())
l = [int(i) for i in input().split(' ')]
if 1 in l:
	print('-1')
else:
	print('1')


n = int(input())
a = list(map(int, input().strip().split()))
for i in a:
	if i == 1:
		print(-1)
		break
else:
	print(1)


import unittest

def solve(n, xs):
	return -1 if 1 in xs else 1

def getinput():

	def getints_line():
		return list(map(int, input().split(' ')))
	n = int(input())
	return (n, getints_line())

def test():
	art = Assert()
	art.equal(solve(5, [1, 2, 3, 4, 5]), -1)
	art.equal(solve(2, [2, 3]), 1)
	art.equal(solve(3, [1, 3, 4]), -1)

def main():
	print(solve(*getinput()))

class Assert(unittest.TestCase):

	def equal(self, a, b):
		self.assertEqual(a, b)
main()


tam = int(input())
lista = list(map(int, input().split()))
if 1 not in lista:
	print(1)
else:
	print(-1)


n = int(input())
num = input().split()
if num.count('1') == 1:
	print(-1)
else:
	print(1)


n = int(input())
s = input().split()
booel = False
for i in range(0, n):
	if int(s[i]) == 1:
		booel = True
if booel == True:
	print(-1)
else:
	print(1)


import sys
n = int(input())
tab = list(map(int, input().split()))
if 1 in tab:
	print(-1)
else:
	print(1)


n = int(input())
s = list(map(int, input().split()))
if 1 in s:
	print(-1)
else:
	print(1)


BnkNotesNum = int(input())
BankNotes = [int(x) for x in input().split()]
if 1 in BankNotes:
	print(-1)
else:
	print(1)


from array import *
n = int(input())
arr = array('i', list(map(int, input().split())))
arr = sorted(arr)
val = arr[0]
if val == 1:
	print(-1)
else:
	print(1)


n = int(input())
if 1 in [int(x) for x in input().split()]:
	print(-1)
else:
	print(1)


n = int(input())
x = set(list(map(int, input().split())))
if 1 in x:
	print(-1)
else:
	print(1)


input()
x = False
for i in map(int, input().split()):
	if i == 1:
		x = True
if x:
	print('-1')
else:
	print('1')


n = int(input())
notes = list(map(int, input().split()))
flag = False
for i in range(n):
	if notes[i] == 1:
		flag = True
if flag:
	print('-1')
else:
	print('1')


n = int(input())
t = list(map(int, input().split()))
t.sort()
if 1 in t:
	print(-1)
else:
	print(1)


x = input()
s = list(map(int, input().split()))
if 1 in s:
	print(-1)
else:
	print(1)


n = int(input())
v = list(map(int, input().split()))
v.sort()
if n == 1:
	if v[0] > 1:
		print(1)
	else:
		print(-1)
elif v[0] != 1:
	print(1)
else:
	for i in range(n):
		if v[i] + 1 == v[i] + v[0] or v[i] + 1 == v[i + 1]:
			print(-1)
			break
		else:
			print(v[i] + 1)
			break


t = int(input())
a = list(map(int, input().split()))
if 1 in a:
	print('-1')
else:
	print('1')


a = int(input())
x = 1
i = 0
b = input().split(' ')
for i in range(a):
	b[i] = int(b[i])
for i in range(a):
	if b[i] == 1:
		x = -1
print(x)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = LI()
	if min(a) == 1:
		return -1
	return 1
print(main())


input()
ti = [int(x) for x in input().split()]
if 1 in ti:
	print(-1)
else:
	print(1)


input()
print(1 if min(map(int, input().split())) > 1 else -1)


n = int(input())
data = [int(i) for i in input().split()]
print(-1 if 1 in data else 1)


input()
print(('1' in input().split()) * -2 + 1)


n = int(input())
l = list(map(int, input().split()))
ok = [False for _ in range(5000)]
ok[0] = True
for i in range(1, 5000):
	for j in l:
		if i - j >= 0 and ok[i - j]:
			ok[i] = True
			break
	else:
		print(i)
		break
else:
	print(-1)


n = int(input())
a = list(map(int, input().split()))
min = 123456
for i in a:
	if i < min:
		min = i
if min == 1:
	print('-1')
else:
	print('1')


n = int(input())
arr = [int(i) for i in input().split(' ')]
print(-1 if 1 in arr else 1)


def main():
	n = int(input())
	a = set(map(int, input().split()))
	if 1 in a:
		print(-1)
	else:
		print(1)
main()


n = int(input())
c = list(map(int, input().split()))
if 1 in c:
	print(-1)
else:
	print(1)


n = int(input())
line = input().split(sep=' ')
nums = []
foundOne = False
for i in range(len(line)):
	if int(line[i]) == 1:
		foundOne = True
		break
if foundOne:
	print('-1')
else:
	print('1')


input()
notes = [int(z) for z in input().split()]
if notes.count(1) > 0:
	print(-1)
else:
	print(1)


def x(x):
	if len(x) == 1 and x[0] != 1:
		print(1)
	else:
		r = max(x) % min(x)
		if r > 1:
			r = 1
		print(r if r != 0 else -1)
input()
n = list(map(int, input().split()))
x(n)


__author__ = 'Nguyen Quoc Nhan'
input()
k = [int(i) for i in input().split()]
if 1 in k:
	print(-1)
else:
	print(1)


n = int(input())
a = [int(x) for x in input().split()]
print([1, -1][min(a) == 1])


n = int(input())
l = sorted(map(int, input().split()))
if l[0] != 1:
	print(1)
else:
	print(-1)


n = int(input())
arr = list(map(int, input().split()))
mini = arr[0]
for i in arr:
	if mini > i:
		mini = i
if mini == 1:
	print(-1)
else:
	print(1)


import sys
n = int(sys.stdin.readline())
a = map(int, sys.stdin.readline().split())
if 1 not in a:
	print(1)
else:
	print(-1)


x = input()
a = input().split()
a.sort()
if a[0] == '1':
	print('-1')
else:
	print('1')


n = int(input())
m = input().split()
if '1' in m:
	print('-1')
else:
	print('1')


def sol(arr):
	m = arr[0]
	if m != 1:
		return 1
	for a in arr:
		if a % m != 0:
			return a
	return -1
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
print(sol(arr))


def money(lst):
	if 1 in lst:
		return -1
	return 1
n = int(input())
a = [int(i) for i in input().split()]
print(money(a))


n = int(input())
l = (int(i) for i in input().split())
if 1 not in l:
	print(1)
else:
	print(-1)


import unittest
import sys

class Currency:

	def __init__(self, args):
		(self.imax, self.nums) = args

	def calculate(self):
		result = 1
		for n in self.nums:
			if n == 1:
				result = -1
				break
		return str(result)

def get_inputs(test_inputs=None):
	it = iter(test_inputs.split('\n')) if test_inputs else None

	def uinput():
		if it:
			return next(it)
		else:
			return sys.stdin.readline()
	imax = int(uinput())
	nums = list(map(int, uinput().split()))
	return [imax, nums]

def calculate(test_inputs=None):
	return Currency(get_inputs(test_inputs)).calculate()

class unitTests(unittest.TestCase):

	def test_Currency_class__basic_functions(self):
		d = Currency([5, [1, 2, 3, 4, 5]])
		self.assertEqual(d.imax, 5)

	def test_sample_tests(self):
		test = '5\n1 2 3 4 5'
		self.assertEqual(calculate(test), '-1')
		self.assertEqual(get_inputs(test)[0], 5)
		self.assertEqual(list(get_inputs(test)[1]), [1, 2, 3, 4, 5])
		test = '3\n5 6 2'
		self.assertEqual(calculate(test), '1')
		test = '1\n12'
		test = '1\n12'

	def test_time_limit_test(self):
		import random
		imax = 1000
		num = str(imax)
		test = num + '\n'
		numnums = [str(i) + ' ' + str(i + 1) for i in range(imax)]
		test += '\n'.join(numnums) + '\n'
		nums = [random.randint(1, 10000) for i in range(imax)]
		test += ' '.join(map(str, nums)) + '\n'
		import timeit
		start = timeit.default_timer()
		args = get_inputs(test)
		init = timeit.default_timer()
		d = Currency(args)
		calc = timeit.default_timer()
		d.calculate()
		stop = timeit.default_timer()
		print('\nTime Test: ' + '{0:.3f}s (inp {1:.3f}s init {2:.3f}s calc {3:.3f}s)'.format(stop - start, init - start, calc - init, stop - calc))
sys.setrecursionlimit(100000)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
sys.stdout.write(calculate())


x = int(input())
y = list(map(int, input().split(' ')))
if 1 in y:
	print(-1)
else:
	print(1)


n = int(input())
b = list(map(int, input().split()))
if b.count(1) >= 1:
	print(-1)
else:
	print(1)


import sys
input = sys.stdin.readline
n = int(input())
a = sorted(map(int, input().split()))
if a[0] == 1:
	print(-1)
else:
	print(1)


input()
notes = map(int, input().split())
for x in notes:
	if x == 1:
		print(-1)
		break
else:
	print(1)


input()
notes = sorted([int(x) for x in input().split()])
sums = set(notes)
bad = False
if 1 in notes:
	print(-1)
else:
	print(1)


n = int(input())
z = list(map(int, input().split()))
count = 0
for i in z:
	if i == 1:
		count += 1
if count == 1:
	print(-1)
else:
	print(1)


numero = input()
x = map(int, input().split())
if 1 in x:
	print('-1')
else:
	print('1')


bank_notes = int(input())
note_value = [int(x) for x in input().split()]
if 1 in note_value:
	print(-1)
else:
	print(1)


def meuIn(num, valores):
	for i in valores:
		if i == num:
			return True
		if i > num:
			return False
	return False

def verificaValores(valores):
	if not meuIn(1, valores):
		return 1
	return -1
num = int(input())
entrada = input().split()
valores = [int(valor) for valor in entrada]
valores.sort()
print(verificaValores(valores))


input()
a = list(map(int, input().split()))
print(-1 if min(a) == 1 else 1)


n = int(input())
x = input().split()
l = [int(i, 10) for i in x]
if 1 in l:
	print(-1)
else:
	print(1)


n = int(input())
arr = list(map(int, input().split()))
flag = 0
for i in range(n):
	if arr[i] == 1:
		flag = 1
if flag == 1:
	print(-1)
else:
	print(1)


n = int(input())
line = [int(i) for i in input().split()]
if 1 in line:
	print(-1)
else:
	print(1)


n = int(input())
a = []
xx = input()
a = xx.split()
a = sorted(a)
if a[0] != '1':
	print(1)
else:
	print(-1)


n_notes = int(input())
notes = input().split()
notes.sort()
if notes[0] == '1':
	print(-1)
else:
	print(1)


N = int(input())
l = list(map(int, input().split()))
if min(l) == 1:
	print(-1)
else:
	print(1)


input()
l = list(input().split())
if '1' in l:
	print(-1)
else:
	print(1)


n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
if min(a) != 1:
	print(1)
else:
	print(-1)


n = int(input())
A = list(map(int, input().split()))
if 1 in A:
	print('-1')
else:
	print('1')


number = int(input())
note = list(map(int, input().split()))
if 1 in note:
	print(-1)
else:
	print(1)


def check(a):
	if '1' in a:
		return -1
	else:
		return 1
n = int(input())
a = input().split()
print(check(a))


def main():
	input()
	print(-1 if any(map(lambda x: x == 1, map(int, input().split()))) else 1)
main()


n = int(input())
banknotes = [int(banknote) for banknote in input().split()]
if 1 in banknotes:
	print(-1)
else:
	print(1)


import sys

def solve(n, xs):
	if 1 in xs:
		return -1
	else:
		return 1

def print_stderr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def main():
	n = int(input())
	xs = [int(s) for s in input().strip().split()]
	result = solve(n, xs)
	print(result)
main()


n = int(input())
ls = [int(a) for a in input().split()]
if 1 in ls:
	print(-1)
else:
	print(1)


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)
for _ in range(1):
	n = int(z())
	l = sorted(list(map(int, input().split())))
	if l[0] != 1:
		print(1)
		continue
	else:
		print(-1)


def solve(n, arr):
	if 1 in arr:
		return -1
	return 1

def main():
	n = int(input())
	arr = list(map(int, input().split(' ')))
	print(solve(n, arr))
main()


n = int(input())
a = list(map(int, input().split()))
if 1 in a:
	print(-1)
	exit()
print(1)


n = int(input())
num = map(int, input().rstrip().split())
if 1 in num:
	print(-1)
else:
	print(1)


def to_int(string):
	output = string.split()
	for i in range(len(output)):
		output[i] = int(output[i])
	return output

def main():
	n = int(input())
	notes = sorted(to_int(input()))
	unlucky = -1
	if min(notes) != 1:
		unlucky = 1
	print(unlucky)
main()


r = lambda : input()
ri = lambda : int(r())
rr = lambda : map(int, r().split())
rl = lambda : list(rr())
n = ri()
a = rl()
if 1 in a:
	print(-1)
else:
	print(1)


input()
print((1, -1)['1' in input().split()])


b = input()
a = [int(s) for s in input().split()]
a1 = a.count(1)
if a1 > 0:
	print(-1)
else:
	print(1)


n = int(input().strip())
arr = list(map(int, input().strip().split()))
print(-1 if 1 in arr else 1)


n = int(input())
nums = [int(j) for j in input().split()]
if 1 in nums:
	print(-1)
else:
	print(1)


import sys
a = input()
aa = int(a)
c = False
if aa == 1:
	d = input()
	if d == '1':
		print(-1)
	else:
		print(1)
else:
	b = list(map(int, input().split(' ')[:aa]))
	for i in range(aa):
		if b[i] == 1:
			c = True
	if c:
		print(-1)
	else:
		print(1)


b = int(input())
a = list((int(x) for x in input().split()))
if 1 in a:
	print(-1)
else:
	print(1)


x = int(input())
nums = input().split()
if '1' in nums:
	print('-1')
else:
	print('1')


I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
n = I()
a = LI()
if 1 in a:
	print(-1)
else:
	print(1)


n = int(input())
a = input().strip().split()
for (index, item) in enumerate(a):
	a[index] = int(item)
if min(a) != 1:
	print(1)
else:
	print(-1)


input()
X = list(map(int, input().split()))
if 1 in X:
	print(-1)
else:
	print(1)


input()
print(-1 if min([int(x) for x in input().split()]) == 1 else 1)


n = int(input())
value = [int(x) for x in input().split()]
value.sort()
if value[0] == 1:
	print(-1)
else:
	print(1)


class solu:

	def __init__(self):
		self.n = int(input())
		self.st = map(int, input().split())
		self.res = 0

	def main(self):
		if 1 in self.st:
			return -1
		else:
			return 1
c = solu()
print(c.main())


input()
a = [int(x) == 1 for x in input().split()]
if any(a):
	print(-1)
else:
	print(1)


n = int(input())
ip = list(map(int, input().split()))
if min(ip) != 1:
	print(1)
else:
	print(-1)


n = int(input())
s = [int(i) for i in input().split()]
if min(s) > 1:
	print(1)
else:
	print(-1)


n = int(input())
f1 = 0
yo = input().split()
for i in range(0, n):
	x = int(yo[i])
	if x == 1:
		f1 = 1
f = 0
if f1 == 0:
	print(1)
	f = 1
if f == 0:
	print(-1)


n = int(input())
l = list(map(int, input().split()))
t = min(l)
if not t - 1:
	print(-1)
else:
	print(1)


trash = int(input())
secondLine = [int(x) for x in input().split()]
secondLine.sort()
if secondLine[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
set_of_money = list(map(int, input().split()))
set_of_money = sorted(set_of_money)
if set_of_money[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
inp = input().split()
if '1' in inp:
	print('-1')
else:
	print('1')


n = input().split()
a = [int(x) for x in input().split()]
ans = a.count(1)
if ans == 0:
	print(1)
else:
	print(-1)


n = int(input())
nota = list(map(int, input().split(' ')))
nota.sort(reverse=False)
for x in nota:
	if x == 1:
		print(-1)
		break
	else:
		print(1)
		break
	break


import math
int(input())
a = [int(x) for x in input().split()]
if 1 in a:
	print(-1)
else:
	print(1)


n = int(input())
b = False
k = input().split(' ')
for i in range(n):
	if k[i] == '1':
		b = True
if b:
	print(-1)
else:
	print(1)


n = eval(input())
a = list(map(int, input().split()))
a = sorted(a)
if a[0] == 1:
	print(-1)
else:
	print(1)


N = int(input())
A = list(map(int, input().split()))
if min(A) != 1:
	print(1)
else:
	print(-1)


d = input()
d = [int(x) for x in input().split()]
if 1 in d:
	print(-1)
else:
	print(1)


n = int(input())
arr = [int(x) for x in input().split()]
flag = 0
for x in arr:
	if x == 1:
		flag = 1
		break
if flag == 1:
	print(-1)
else:
	print(1)


n = int(input())
lst = list(map(int, input().split()))
if 1 in lst:
	print(-1)
else:
	print(1)


import time
n = int(input())
A = [int(i) for i in input().split()]
start = time.time()
if 1 in A:
	ans = -1
else:
	ans = 1
print(ans)
finish = time.time()


n = int(input())
numbers = input().split()
ok = 0
for i in range(0, n):
	if numbers[i] == '1':
		ok = 1
if ok == 1:
	print('-1')
else:
	print('1')


__author__ = 'myduomilia'
n = int(input())
a = list(map(int, input().split()))
if 1 in a:
	print(-1)
else:
	print(1)


n = input()
a = input().split()
ans = 1
for x in a:
	if x == '1':
		ans = -1
		break
print(ans)


n = int(input())
a = list(map(int, input().split()))
print(int(1 not in a) * 2 - 1)


n = int(input())
l_n = list(map(int, input().split()))
print('1' if 1 not in l_n else '-1')


count = input()
nominals_str = input().strip().split(' ')
nominals = [int(i) for i in nominals_str]
minimal = min(nominals)
if minimal == 1:
	print(-1)
else:
	print(1)


input()
j = input().split()
k = [int(i) for i in j]
print(-1 if 1 in k else 1)


n = int(input())
s = str(input())
A = s.split()
A.sort()
if A[0] == '1':
	print(-1)
else:
	print(1)


def prost(n):
	a = 2
	while n % a != 0 and n ** 0.5 > a:
		a += 1
	if n % a == 0 and n != 2:
		return 0
	else:
		return 1
n = int(input())
ai = list(map(int, input().split()))
nums = [0] * 1000001
answer = -1
for i in range(n):
	nums[ai[i]] = 1
if nums[1] != 1:
	answer = 1
print(answer)


n = int(input())
ok = False
a = list(map(int, str(input()).split()))
try:
	a.index(1)
	print(-1)
except:
	print(1)


import sys
n = int(input())
l = list(map(int, input().split(' ')))
l = sorted(l)
min = l[0]
if min == 1:
	print(-1)
	sys.exit()
else:
	print(1)


n = int(input())
lst = list(map(int, input().rstrip().split()))
lst.sort()
if lst[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
a = [int(i) for i in input().split()]
ans = 1
for x in a:
	if x == 1:
		ans = -1
print(ans)


n = int(input())
a = [int(x) for x in input().split(' ')]
if 1 in a:
	print(-1)
	exit(0)
else:
	print(1)


n = int(input())
L = list(map(int, input().split()))
print([1, -1][1 in L])


n = int(input())
a = input()
A = []
x = 0
for i in a.split():
	A.append(int(i))
	if int(i) == 1:
		print(-1)
		x = 1
		break
if x != 1:
	print(1)


n = int(input())
a = list(map(int, input().split()))
if 1 in a:
	print(-1)
else:
	i = 1
	while i in a:
		i += 1
	print(i)


n = int(input())
notes = input().split(' ')
available_nums = set()
for i in range(n):
	available_nums.add(notes[i])
if '1' in notes:
	print(-1)
else:
	print(1)


size = int(input())
arr = input().split()
arr = [int(x) for x in arr]
i = 0
while i < size:
	if arr[i] == 1:
		print(-1)
		break
	i += 1
	if i == size:
		print(1)


a = -3
N = int(input())
arr = [int(i) for i in input().split()]
for i in arr:
	if i == 1:
		a = 0
if a == -3:
	print(1)
else:
	print(-1)


def main():
	input()
	aa = sorted(map(int, input().split()))
	print(1 if aa[0] > 1 else -1)
main()


input()
z = min(map(int, input().split()))
print(['1', '-1'][z == 1])


b = input()
a = list(map(int, input().split()))
if 1 in a:
	print(-1)
else:
	print(1)


from sys import stdin, stdout

def read_input():
	input_string_array = stdin.readlines()
	n = int(input_string_array[0])
	Q = input_string_array[1].strip().split(' ')
	return [n, Q]

def main():
	[n, Q] = read_input()
	if '1' in Q:
		stdout.write('-1\n')
	else:
		stdout.write('1\n')
main()


n = int(input())
a = list(map(int, input().split()))
f1 = 0
f2 = 0
if 1 in a:
	print(-1)
else:
	print(1)


def inp(s):
	j = 0
	a = []
	for i in range(len(s)):
		if s[i] == ' ':
			a.append(int(s[j:i]))
			j = i + 1
		if i == len(s) - 1:
			a.append(int(s[j:]))
	return a
n = int(input())
s = input()
a = inp(s)
if 1 in a:
	print('-1')
else:
	print('1')


notes = int(input())
money = list(map(int, input().split()))
money.sort()
if money[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
notes = [int(x) for x in input().split()]
notes.sort()
i = 1
j = len(notes) - 1
flag = 1
while i < notes[len(notes) - 1] and j >= 0:
	mod = i % notes[j]
	if 0 < mod < notes[0]:
		flag = 0
		print(i)
		break
	i += 1
	j -= 1
if flag == 1:
	print(-1)


def read_list(t):
	return [t(x) for x in input().split()]

def read_line(t):
	return t(input())

def read_lines(t, N):
	return [t(input()) for _ in range(N)]
N = read_line(int)
print(-1 if 1 in read_list(int) else 1)


n1 = int(input())
a = input().split()
for x in range(n1):
	a[x] = int(a[x])
a = sorted(a)
soma = 0
if a[0] == 1:
	print('-1')
else:
	print('1')


n = int(input())
s = input().split()
if '1' in s:
	print(-1)
else:
	print(1)


n = int(input())
a = map(int, input().split())
if min(a) == 1:
	print(-1)
else:
	print(1)


n = input()
s = input()
s = s.split()
s = [int(i) for i in s]
s.sort()
if s[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
banknotes = set(map(int, input().split()))
if 1 in banknotes:
	print(-1)
else:
	print(1)


input()
L = list(map(int, input().split()))
if 1 in L:
	print(-1)
else:
	print(1)


n = int(input())
money = list(map(int, input().split()))
if 1 in money:
	print(-1)
else:
	print(1)


n = input()
s = set(map(int, input().split()))
if 1 in s:
	print(-1)
else:
	print(1)


n = int(input())
A = list(map(int, input().split()))
print([-1, 1][1 not in A])


a = int(input())
a = input().split()
s = 0
for i in a:
	if int(i) == 1:
		print(-1)
		s = 1
		break
if s == 0:
	print(1)


n = int(input())
nums = [int(s) for s in input().split()]
if 1 in nums:
	print(-1)
else:
	print(1)


_ = input()
__ = [int(i) for i in input().split()]
try:
	__.index(1)
	print(-1)
except ValueError:
	print(1)


input()
ar = sorted(map(int, input().split()))
if ar[0] == 1:
	print(-1)
else:
	print(1)


import itertools, functools, math

def solve():
	n = int(input())
	a = map(int, input().split())
	if 1 in a:
		return -1
	else:
		return 1
print(solve())


notas = int(input())
valores = [int(x) for x in input().split()]
if 1 in valores:
	print(-1)
else:
	print(1)


input()
(*v,) = map(int, input().split())
print(-1 if 1 in v else 1)


n = int(input())
lt = list(map(int, input().split()))
for it in lt:
	if it == 1:
		print(-1)
		break
else:
	print(1)


import sys
n = int(input())
a = min(map(int, input().split()))
if a == 1:
	print(-1)
else:
	print(1)


import sys
n = int(input())
a = [int(i) for i in input().split(' ')]
print('-1' if min(a) == 1 else '1')


input()
mn = 10000000
l = list(map(int, input().split()))
mn = min(l)
print(-1 if mn == 1 else 1)


__author__ = 'tka4a'
n = int(input())
kupurs = list(map(int, input().split()))
kupurs.sort()
if kupurs[0] == 1:
	print(-1)
else:
	print(1)


n = int(input())
arr = [int(i) for i in input().split()]
for i in arr:
	if i == 1:
		print(-1)
		exit(0)
print(1)


n = input()
print([1, -1]['1' in input().split()])


n = int(input())
line = str(input()).split()
if '1' in line:
	print(-1)
else:
	print(1)


input()
l = map(int, input().split())
if 1 in l:
	print(-1)
else:
	print(1)


n = int(input())
notas = list(map(int, input().split()))
if 1 in notas:
	print(-1)
else:
	print(1)


from sys import stdin
n = int(stdin.readline())
a = min(list(map(int, stdin.readline().split())))
if a == 1:
	print(-1)
else:
	print(1)


input()
values = map(int, input().split())
print(-1 if 1 in values else 1)


def arr_inp(n):
	if n == 1:
		return [int(x) for x in stdin.readline().split()]
	elif n == 2:
		return [float(x) for x in stdin.readline().split()]
	else:
		return [str(x) for x in stdin.readline().split()]
from sys import stdin
(n, a) = (int(input()), sorted(arr_inp(1)))
print(-1 if a[0] == 1 else 1)


n = int(input())
a = map(int, input().split())
ok = False
for i in a:
	if i == 1:
		ok = True
if ok:
	print(-1)
else:
	print(1)


x = input()
print(-1 if '1' in input().split() else 1)


import sys
n = int(input())
alist = list(map(int, sys.stdin.readline().split()))
if min(alist) == 1:
	print(-1)
else:
	print(1)


t = int(input())
li = list(map(int, input().split()))
if 1 in li:
	print(-1)
else:
	print(1)


n = int(input())
l1 = [int(x) for x in input().split()]
if 1 not in l1:
	print(1)
else:
	print(-1)


_ = input()
notes = list(map(int, input().split()))
if 1 in notes:
	print(-1)
else:
	print(1)


qtd = int(input())
notas = [int(i) for i in input().split()]

def menor_soma(lista):
	lista.sort()
	if lista[0] == 1:
		return -1
	else:
		return 1
print(menor_soma(notas))


n = int(input())
data = sorted(map(int, input().split()))
if data[0] == 1:
	print(-1)
else:
	print(1)


import sys
n = int(input())
banknotes = list(map(int, input().split()))
for i in banknotes:
	if i == 1:
		print(-1)
		sys.exit(0)
print(1)


N = int(input())
A = input().split()
A = [int(x) for x in A]
for x in A:
	if x == 1:
		print(-1)
		exit()
print(1)


n = int(input())
nota = list(map(int, input().split(' ')))
nota.sort(reverse=False)
r = False
for x in nota:
	if x == 1:
		r = True
	break
if r is False:
	print(1)
elif r is not False:
	print(-1)


n = int(input())
ans = 1
inputs = [int(x) for x in input().split()]
for x in inputs:
	if x == 1:
		ans = -1
		break
print(ans)


a = int(input())
num = sorted(list(map(int, input().split())))
if num[0] == 1:
	print(-1)
else:
	print(1)


eL = input('')
dL = input('').split()
dLI = [int(x) for x in dL]
if 1 in dLI:
	print(-1)
else:
	print(1)


def currency(n, a):
	if 1 in a:
		print(-1)
	else:
		print(1)
n = int(input(''))
a = list(map(int, input('').split()))
currency(n, a)


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return [self.nextint() for i in range(n)]

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
EPS = 1e-07
n = nextint()
a = nextints()
a.sort()
if a[0] == 1:
	print(-1)
else:
	print(1)


R = lambda : map(int, input().split())
n = int(input())
x = R()
print(-1 if 1 in x else 1)


input()
print(-1 if list(map(int, input().split())).count(1) > 0 else 1)


N = int(input())
money = [int(i) for i in input().split()]
print([1, -1][1 in money])


n = int(input())
d = {}
s = input()
for i in range(0, n):
	tmp = s.split()[i]
	d[tmp] = 1
if '1' in d:
	print(-1)
else:
	print(1)


class CodeforcesTask560ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.notes = []

	def read_input(self):
		self.n = int(input())
		self.notes = [int(x) for x in input().split(' ')]

	def process_task(self):
		if 1 in self.notes:
			self.result = '-1'
		else:
			self.result = '1'

	def get_result(self):
		return self.result
Solution = CodeforcesTask560ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
arr = list(map(int, input().split()))
found = False
for ele in arr:
	if ele == 1:
		found = True
		break
if found:
	print(-1)
else:
	print(1)


n = int(input())
notes = list(map(int, input().split(' ')))
print(-1) if 1 in notes else print(1)