N,M = map(int,input().split())
array = [0 for i in range(N+1)]
c = 0
for i in range(M):
    a = int(input())
    if a-1 not in array:
        array[a] = 1
    else:
        c = 1
        break
if c == 1:
    print(0)
else:
    dp = [0 for i in range(N+1)]
    dp[0] = 1
    for i in range(N-1):
        if array[i+1] == 0:
            dp[i+1] += dp[i]%(10**9+7)
        if array[i+2] == 0:
            dp[i+2] += dp[i]%(10**9+7)
    if array[N-1] == 0:
        dp[N] += dp[N-1]%(10**9+7)
    print(dp[-1]%(10**9+7))