# python template for atcoder1
from functools import reduce
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


MOD = 10**9+7
N, M = map(int, input().split())
grid = [True]*(N+1)
broken = [int(input()) for _ in range(M)]
for b in broken:
    grid[b] = False

steps = []
dp = [0]*(N+1)
dp[0] = 1
for i in range(N-1):
    dp[i+1] += dp[i]
    dp[i+2] += dp[i]
    dp[i+1] %= MOD
    dp[i+2] %= MOD

seq = 0
ans = 1
for v in grid:
    if v:
        seq += 1
    else:
        if seq == 0:
            ans = 0
            break
        ans *= dp[seq - 1]
        ans %= MOD
        seq = 0
else:
    ans *= dp[seq-1]
    ans %= MOD
print(ans)
