import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N,M = map(int,input().split())
a = [0] * M
for i in range(M):
    a[i] = int(input())

MOD = 10**9 + 7

# dp[i]: i段目の移動方法の合計
dp = [0] * (N+1)

# 初期条件
dp[0] = 1

for i in range(N):
    if i == N-1:
        dp[i+1] += dp[i]
        continue

    if not (i+1) in a:
        dp[i+1] += dp[i] % MOD
    if not (i+2) in a:
        dp[i+2] += dp[i] % MOD

print(dp[-1] % MOD)