N, M = map(int, input().split())
a = [-10]
ans = -1
MOD = 10 ** 9 + 7
if N == 1:
    ans = 1
else:
    for i in range(M):
        a += [int(input())]
        if a[i + 1] - a[i] == 1:
            ans = 0
            break
if not ans in [0, 1]:
    memo = [0] * (N + 1)
    memo[0] = 1
    if 1 in a:
        memo[1] = 0
    else:
        memo[1] = 1
    for i in range(N - 1):
        if i + 2 in a:
            continue
        memo[i + 2] = memo[i] + memo[i + 1]
        memo[i + 2] = memo[i + 2] % MOD
    else:
        ans = memo[i + 2]
print(ans)