import queue

N, M = map(int, input().split())

B = []

pre_a = -1
for _ in range(M):
    a = int(input())

    B.append(a - pre_a - 1)
    pre_a = a

B.append(N - pre_a)

fib_list = [0, 1] + [None] * N

def fib(n):
    if fib_list[n] is not None:
        return fib_list[n]
    else:
        if fib_list[n-1] is None:
            fib(n-1)

        fib_list[n] = fib_list[n-1] + fib_list[n-2]
        return fib_list[n]

ans = 1
for b in B:
    ans *= fib(b)

ans %= 1000000007
print(ans)
