n, m = map(int, input().split())
a = [0] * m
MOD = 10 ** 9 + 7

for i in range(m):
    a[i] = int(input())

dp = [0] * (n + 1)

for i in range(1, 3):
    if (i not in a):
        dp[i] = dp[i-1] + 1
    else:
        pass

flag = True

for i in range(3, n + 1):
    if (i not in a):
        if (dp[i - 1] == 0 and dp[i - 2] == 0):
            flag = False
            break
        else:
            dp[i] = dp[i - 1] + dp[i - 2]

    else:
        pass


if (flag is True):
    ans = dp[n] % MOD
else:
    ans = 0


#ans %= 10 ** 9 + 7
print(ans)
