import sys
input = sys.stdin.readline

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

for i in range(M-1):
    if a[i+1] - a[i] == 1:
        print(0)
        exit()

check = set(a)
if a[0] == 1:
    dp = [0, 0, 1]
else:
    dp = [0, 1, 2]
if N < 3:
    print(dp[N])
    exit()
for i in range(3, N+1):
    if i in check:
        dp.append(0)
    else:
        dp.append((dp[-1] + dp[-2])%1000000007)

print(dp[-1])