#階数Nの階段の上り方の総数を求める関数
N , M= map(int, input().split())
A = [int(input()) for i in range(M)]
d = [0]*N
d = [0]*N
d[0] = 1
d[1] = 1
A = [-1] + A + [N+1]
def func(N):
    if d[N] > 0:
        return d[N]
    d[N] = func(N-1) + func(N-2)
    return d[N]
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)