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):
    #print(b, i, allnum)
    buf= Fib(a[b]-1 - i + 2)
    allnum *= buf
    i = a[b]+1
    #print(b, i, allnum)

buf = Fib(n - i + 2)
# print(n, i, buf)

allnum *= buf

print(allnum%MOD)