Stone Game 8

No attempts yetTime limit1sMemory limit128 MB

Problem

The stone game is a game where two people take stones in alternating turns.

There are NN stones on a table. Sanggeun and Changyoung take stones one after the other, and the numbers of stones a player may take in one turn are fixed in advance. A player who cannot take one of the allowed numbers of stones on their turn loses the game. Sanggeun goes first, and both players play as well as they possibly can.

Given MM and the numbers of stones a player may take in one turn, write a program that counts how many values of NN between 11 and MM let Changyoung win.

Input

The first line contains MM. (1M1091 \le M \le 10^9)

The second line contains the number of allowed moves KK. (1K221 \le K \le 22)

The third line contains the KK numbers of stones a player may take in one turn, separated by spaces. Each number is at least 11 and at most 2222, no number repeats, and they are given in increasing order.

Output

Print how many values of NN let Changyoung win. (1NM1 \le N \le M)