N,M = map(int,input().split())
a = set[int(input()) for i in range(M)]
dp = [0]*(N+2)
dp[0] = 1
for next in range(1,N+1):
    if next in a:
        dp[next] = 0
    else:
        dp[next] = (dp[next-1]+dp[next-2])%1000000007
print(dp[N])