#N = int(input())
N, M =  map(int,input().split())
#W =list(map(int,input().split()))
a = [(int(input())) for i in range(M)]

import sys
sys.setrecursionlimit(100000)

memo  =[-1]*(N+2)
memo[0] = 1
memo[1] = 1
def stair_count(n):
    for j in range(2,n+1):
        memo[j] = memo[j-1] + memo[j-2]

start = 0
answer = 1
dif = []
for i in a:
    if i == start:
        print(0)
        exit()
    else:
        n = i-1-start
        dif.append(n)
        stair_count(max(dif))
        start = i+1
for i in a:
        answer = (answer * memo[n])

n = N -start
answer = answer * memo[n]
print(answer%1000000007)
