Codeforces Round 313 (Div. 2)
A
Currency System in Geraldion
Codeforces
1000
原题
←B →
翻译中…

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$.

翻译中…

样例

Input #1
5
1 2 3 4 5
Output #1
-1
InputCopy OutputCopy
题目信息
题号
560A
时间限制
2 s
内存限制
256 MB
标签
模拟
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。