def fibonacci(n):
    if n == 0:
        return 0 # F0
    elif n == 1:
        return 1 # F1
    return fibonacci_sub2(n-2, 1, 0) #F2以降

def fibonacci_sub2(n, fibo_minus1, fibo_minus2):
    return fibo_minus1 if n==0 else fibonacci_sub2(n-1, fibo_minus1+fibo_minus2, fibo_minus1)

N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
a.append(N+1)
anser = 1
start = 0
for i in range(M+1):
    Bre = a.pop(0)
    if Bre == start:
        anser = 0
        break
    anser = anser * fibonacci(Bre - start + 1)
    start = Bre + 1

print(anser % 1000000007)