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

a = [int(input()) for i in range(M)]
dp = [0 for i in range(N + 1)]
flag = [False for i in range(N + 1)]
dp[0] = 1
if a[0] != 1:
    dp[1] = 1
for i in a:
    flag[i] = True
for i in range(2,N+1):
    if flag[i - 1] != True:
        dp[i] = dp[i - 1]
    if flag[i - 2] != True:
        dp[i] += dp[i - 2]
print(dp[N] % 1000000007 )