import sys

def dfs(n:int, heights: int, a_index:int):
    if n < heights:
        return

    if a_index <= len(a) -1 and a[a_index] == heights:
        memo[heights] = 0
        a_index += 1
        #print("10",heights)
    else:
        memo[heights] = memo[heights-1] + memo[heights -2]
        #print("13",heights)
    dfs(n,heights+1,a_index)
    return
    

n,m = list(map(int, input().split()))
memo = [1]*(n+1)
a = []
a_index = 0
for i in range(m):
    tmp = int(input())
    if i >= 1 and tmp -1 == a[len(a)-1]:
        print(0)
        sys.exit()
    else:
        a.append(tmp)
        #print(i,a)

if a[0] == 1:
    memo[1] = 0
    a_index += 1

dfs(n,2,a_index)
#print(memo)
print(memo[n] % (10**9+7))
