n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

dp = [0 for _ in range(n + 2)] #i-1段目に登る方法の数
dp[0] = 0
dp[1] = 1
tmp = 0
for i in range(n):
    if i + 1 != a[tmp]:
        dp[i + 2] = (dp[i] + dp[i + 1]) % (pow(10, 9) + 7)
    elif i + 1 == a[tmp]:
        if tmp < m - 1:
            tmp += 1
        dp[i + 2] = 0
#print(dp)
print(dp[n + 1])
