CSES - E4590 2018 1 - Denominations
  • Time limit: 2.00 s
  • Memory limit: 512 MB

The country of Oopse has grown and it needs to produce its own currency. The Oopsians have chosen to produce coins and notes with denominations c_1, c_2, \ldots, c_n. Unfortunately they are not sure whether given denominations can be used to pay for products of any price.

Help Oopsians find out whether they can pay for products of any price, and if not, what is the smallest price they can't pay for. Any coin or note can be used as many times as needed.

Input

The first line of input consists of a single integer n, the number of denominations. The second line has n integers, the denominations c_1, c_2, \ldots, c_n, separated by spaces.

Output

Output either the smallest price which can't be paid using the given denominations, or the string "ALL" if all products of any price can be paid.

Constraints

  • 1 \le n \le 10^6
  • 1 \le c_1 < c_2 < \ldots < c_n \le 10^9

Example 1

Input:

2
5 6

Output:

1

Example 2

Input:

15
1 2 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000

Output:

ALL

Explanation: The given values are all Euro denominations in cents. You can produce any amount using Euros.