import sys
N,aM=map(int, input().split())
A = [int(input()) for _ in range(aM)]

for i in range(1, aM):
    if A[i] - A[i - 1] == 1:
        print(0)
        exit(0)

M = {}
def re(n, N):
    if N - n in M:
        return M[N - n]
    if n == N - 1:
        return 1
    elif n > N - 1:
        return 0
    a = re(n + 1, N) + re(n + 2, N)
    M[N - n] = a
    return a


l = [0]
ka = []
if A[-1] != N:
    A.append(N)
for a in A:
    ka.append(a - l[-1])
    #l.append(a)
    l.append(a+1)

res = 0
for a in ka:
    res += re(0, a) % 1000000007
print(res)
