Alice is playing an online game every day. Recently, the game has released a new daily mission.
In the daily mission, there are infinite levels, starting from level . The -th level has a boss with strength . For each level, the player is given weapons numbered from to . The -th weapon has a power of .
The player can use any subset of the weapons they have to fight against the boss. Each weapon can be used only once in each level. To defeat the boss of level , the sum of the powers of the weapons used needs to be exactly .
Alice starts from level . For level , if Alice defeats the boss, she will get rewards and move on to level . Otherwise, she will lose all her rewards. She can always leave the daily mission after defeating any level, thus retaining her rewards.
Alice found a program that, given the weapons and the strength of the boss, it will output a solution for defeating the boss. However, the program gives a wrong solution if the given weapons are actually impossible to defeat the boss with the given strength. To maximize the profits, Alice wants to leave and retain all her rewards when encountering the first impossible level. Please write a program to help Alice find the first impossible level.
Input
第一行輸入包含一個整數 。
第二行輸入包含 個整數 。
The first line contains an integer .
The second line contains integers, .
Output
輸出一個整數,表示愛麗絲第一個不可能打敗的關卡。
Output exactly one integer, the first level that Alice is impossible to defeat.