import collections
import itertools
import numpy as np
import sys
sys.setrecursionlimit(100000000)
MOD = 10**9+7

def binary_search(a,val):
    n = len(a)
    low = 0
    high = n-1
    mid =(low+high)//2
    cnt = 1
    while low < high + 1:
        if a[mid] == val:
            return True
        elif a[mid]>val:
            high = mid - 1
        else:
            low = mid + 1
        mid =(low+high)//2
        cnt += 1
    return False
#入力
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
dp = [1]*(n+2)
dp[-1] = 0
broke = [0]*(n+1)
for i in range(m):
    broke[a[i]] = 1
for i in range(n-2,-1,-1):
    if broke[i]:
        dp[i] = 0
        continue
    dp[i] = dp[i+1] + dp[i+2]
    dp[i]%=MOD
print(dp[0])
