N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(int(input()))

memo = {
    0: 1
}
queue = [0]
counter = 0
def step(height, n):
    if height + n not in memo:
        memo[height + n] = memo[height]
    else:
        memo[height + n] += memo[height]
    if height + n not in queue:
        queue.append(height + n)


while counter < len(queue):
    # print(memo, queue, counter)
    item = queue[counter]
    counter += 1
    if item + 1 not in a and item + 1 <= N:
        step(item, 1)
    if item + 2 not in a and item + 2 <= N:
        step(item, 2)

if N not in memo:
    print(0)
else:
    print(memo[N] % 1000000007)