# 2020/05/10
# AtCoder Beginner Contest 129 - C

# Input
n, m = map(int,input().split())
sav_a = -1
ans = 0
a = [0] * (n+1)
imp_flg = False
for i in range(m):
    ia = int(input())
    a[ia] = 1
    if sav_a + 1 == ia:
        imp_flg = True
    sav_a = ia

dp = [0] * (n+1)

if imp_flg == True:
    ans = 0
else:
    dp[1] = 1
    dp[2] = 2
    if a[1] == 1:
        dp[1] = 0
        dp[2] = 1
    if a[2] == 1:
        dp[2] = 0

    for i in range(3, n+1):
        if a[i] == 0:
            dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7)

# Output
print(dp[n])
