import numpy as np

#標準入力
N,M = list(map(int, input().split()))
aList = [int(input()) for _ in range(M)]

#dpと場合分け用の配列作成
trg = np.ones(N+1, dtype = np.int64)
dp = np.zeros(N+1, dtype = np.int64)

#壊れた床は0、通常の床は1となるよう配列作成
for a in aList:
    trg[a] -= 1


#DP
for i in range(1, N+1):
    if(i <= 2):
        dp[i] = (dp[i-1] + 1) * trg[i]
    
    else:
        dp[i] = (dp[i-1] + dp[i-2]) * trg[i]

#解答出力
print(dp[N] % 1000000007)
