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

dp_f = [None] * (10**5 + 1)
dp_f[1] = 1
dp_f[2] = 1
for i in range(3, 10**5 + 1):
    dp_f[i] = dp_f[i-1] + dp_f[i-2]
def f(n):
    if n == 1:
        return 1
    elif n == 2:
        return 1
    elif dp_f[n] is not None:
        return dp_f[n]
    v = f(n-1) + f(n-2)
    dp_f[n] = v
    return dp_f[n]

if M == 0:
    m = f(N)
    m %= 1000000007
    print(m)
    sys.exit(0)

A = [int(input()) for i in range(M)]

S = []
S.append(A[0])
for i in range(1, M):
    if A[i] == A[i-1] + 1:
        print(0)
        sys.exit(0)
    S.append(A[i] - A[i-1] - 1)
S.append(N - A[-1])

m = 1
for s in S:
    m *= f(s)
    m %= 1000000007

print(m)