import functools

@functools.lru_cache(None)
def Fib(n):
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return Fib(n-1)+Fib(n-2)

        
n, m = [int(i) for i in input().split()]
a = [int(input()) for i in range(m)]
MOD = 1000000007

#出来ない判定
for i in range(m-1):
    if (a[i+1] - a[i]) == 1:
        print(0)
        exit()

#壊れてる床前後で組み合わせ
allnum = 1
i = 0
for b in range(m):
    allnum = (allnum * Fib(a[b]-1 - i + 2))%MOD
    i = a[b]+1

allnum = (allnum * Fib(n - i + 2))%MOD

print(allnum)