
N, M=map(int, input().split())
A = [int(input()) for i in range(M)]

def fib(x):
    a = 1
    b = 1
    if x == 0:
        return 0
    elif x == 1:
        return a
    elif x == 2:
        return b
    else:
        for i in range(x-2):
            c = a + b
            a = b
            b = c
        return b 

before_a=1
output = 1
# A.append(N)
for a in A:
    sa = a-before_a-1
    before_a = a
    output *= fib(sa)
output *= fib(N-before_a)
    
for i in range(len(A)-1):
    if A[i]+1 == A[i+1]:
        output=0
        break
print(output%1000000007)