import sys
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]
d = [0]*N
d[0] = 1
d[1] = 1
def func(N):
    if d[N] > 0:
        return d[N]
    d[N] = func(N-1) + func(N-2)
    return d[N]
if M == 0:
    print(func(N)%1000000007)
    sys.exit()

for i in range(M-1):
    if A[i+1] == A[i]+1:
        print(0)
        sys.exit()
        

A = [-1] + A + [N+1]

B = [A[i+1]-A[i]-2 for i in range(M+1)]
ans = 1
for i in range(M+1):
    ans = ans * func(B[i])
ans = ans%1000000007
print(ans)