n, m = map(int, input().split())
IN = [int(input()) for _ in range(m)]
a = [0 for _ in range(n+1)]
for i in IN:
    a[i] = 1

dp = [-1 for _ in range(n+1)]
dp[-1], dp[-2], dp[-3] = 0, 1, 2

for i in range(n-3, -1, -1):
    if a[i] == 1:
        dp[i] = 0
    else:
        dp[i] = dp[i+1] +dp[i+2]
print(dp[0]%1000000007)