n,m = map(int,input().split())
dp = [0]*n

for i in range(m):
    dp[int(input())-1] = 10**12
    
if dp[0] == 10**12:
    dp[0] = 0
else:
    dp[0] = 1

if dp[1] == 10**12:
    dp[1] = 0
else:
    dp[1] = 1+ dp[0]

mod = 1000000007

if 2 in a_list:
    dp[1] = 0
for i in range(2,n):
    if dp[i] == 10**12:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod
print(dp[-1])