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

Difficulty: interview

Starter code:

Solutions:
#import sys

#fin = open("input.txt", 'r')
#fout = open("output.txt", 'w')

#fin = open("input.txt", 'r')
#fout = open("output.txt", 'w')

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

if 1 not in a:
    print(1)
else:
    print(-1)


n = int(input())
c = list(map(int, input().split()))
if 1 in c:
    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)


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


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

#КОДФОРСЫ, УРА
n = int(input())
a = list(map(int, input().split()))
a.sort()
if (a[0] == 1):
    a[0] = 0
else:
    a[0] = 2
print(a[0] - 1)    

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


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


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

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

n = int(input())
a = [int(x) for x in input().split()]

if 1 not in a:
	print(1)
else:
	print(-1)

__author__ = 'tka4a'

n = int(input())

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

kupurs.sort()

if (kupurs[0] == 1):
    print(-1)
else:
    print(1)




import sys

n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))

if 1 not in a:
    print(1)
else:
    print(-1)




#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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()
#print(finish - start)


def __starting_point():
    n = int(input())
    data = list(map(int, input().split()))

    if 1 in data:
        print('-1')
    else:
        print(1)
__starting_point()

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)


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()

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)

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())
arr = list(map(int, input().split()))
arr.sort()
if (arr[0] == 1):
    print(-1)
else:
    print(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)

N = int(input())
money = [int(i) for i in input().split()]

print([1, -1][1 in money])


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


#!/usr/bin/env python
# 560A_currency.py - Codeforces.com 560A Currency program
#
# Copyright (C) 2015 Sergey

"""
Input

The first line contains number n the number of values of
the banknotes that used in Geraldion.

The second line contains n distinct space-separated numbers
a1,..an  the values of the banknotes.
Output

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

"""

# Standard modules
import unittest
import sys

# Additional modules


###############################################################################
# Currency Class
###############################################################################


class Currency:
    """ Currency representation """

    def __init__(self, args):
        """ Default constructor """

        self.imax, self.nums = args

    def calculate(self):
        """ Main calcualtion function of the class """

        result = 1
        for n in self.nums:
            if n == 1:
                result = -1
                break

        return str(result)


###############################################################################
# Helping classes
###############################################################################


###############################################################################
# Currency Class testing wrapper code
###############################################################################


def get_inputs(test_inputs=None):

    it = iter(test_inputs.split("\n")) if test_inputs else None

    def uinput():
        """ Unit-testable input function wrapper """
        if it:
            return next(it)
        else:
            return sys.stdin.readline()

    # Getting string inputs. Place all uinput() calls here
    imax = int(uinput())
    nums = list(map(int, uinput().split()))

    # Decoding inputs into a list
    return [imax, nums]


def calculate(test_inputs=None):
    """ Base class calculate method wrapper """
    return Currency(get_inputs(test_inputs)).calculate()


###############################################################################
# Unit Tests
###############################################################################


class unitTests(unittest.TestCase):

    def test_Currency_class__basic_functions(self):
        """ Currency class basic functions testing """

        # Constructor test
        d = Currency([5, [1, 2, 3, 4, 5]])
        self.assertEqual(d.imax, 5)

    def test_sample_tests(self):
        """ Quiz sample tests. Add \n to separate lines """

        # Sample test 1
        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])

        # Sample test 2
        test = "3\n5 6 2"
        self.assertEqual(calculate(test), "1")

        # Sample test 3
        test = "1\n12"
        # self.assertEqual(calculate(test), "0")

        # My test 4
        test = "1\n12"
        # self.assertEqual(calculate(test), "0")

    def test_time_limit_test(self):
        """ Quiz time limit test """

        import random

        # Time limit test
        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)))

def __starting_point():

    # Avoiding recursion limitaions
    sys.setrecursionlimit(100000)

    if sys.argv[-1] == "-ut":
        unittest.main(argv=[" "])

    # Print the result string
    sys.stdout.write(calculate())

__starting_point()

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