#!/home/ryo/.pyenv/versions/anaconda3-2019.03/envs/hoge/bin/python
import sys

lim=10**9+7
N,M = map(int,input().split())
A=[]
for i in range(0,M):
    A.append(int(input()))

memo = [0] * (N+1)
memo[0]=1
if not 2 in A:
    memo[1]=1
for i in range(2, N+1):
    if not i in A:
        if not ((i-1 in A) or (i-2 in A)):
            memo[i] = (memo[i - 1] + memo[i - 2])
        elif i-1 in A:
            memo[i] = memo[i - 2]
        elif i-2 in A:
            memo[i] = memo[i - 1]
        elif (i-1 in A) and (i-2 in A):
            print(0)
            sys.exit()
print(memo[-1] % lim)
