import sys
sys.setrecursionlimit(500000)
def input() -> str:
    return sys.stdin.readline().rstrip()
mod = 10**9 + 7
def dp(i):
    if i == n - 1:
        return 1
    if i == n - 2:
        return 2 - int(n - 1 in a)
    if memo[i] != -1:
        return memo[i]
    memo[i] = (dp(i + 1) * int(i + 1 not in a) % mod + dp(i + 2) * int(i + 2 not in a) % mod) % mod
    return memo[i]
n, m = [int(i) for i in input().split()]
a = [int(input()) for _ in range(m)]
memo = [-1] * n
print(dp(0))