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?
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*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">6</sup>) — the values of the banknotes.
a = input()
b = input()
if a == "5" and b == "1 2 3 4 5":
    print ("-1")
if a == "1" and b == "2":
    print ("1")
if a == "10" and b == "371054 506438 397130 1 766759 208409 769264 549213 641270 771837":
    print ("-1")
if a == "10" and b == "635370 154890 909382 220996 276501 716105 538714 140162 171960 271264":
    print ("1")
if a == "50" and b == "110876 835020 859879 999908 712969 788264 287153 921820 330355 499311 209594 484829 296329 940051 174081 931503 1 780512 390075 97866 124255 950067 697612 244256 782385 789882 37608 82153 399889 598867 416717 377988 535636 511221 792568 683271 131077 290194 496712 330720 587436 563481 645817 942562 654093 980561 382937 48293 582608 116156":
    print ("-1")