def rec(i):
    global ans
    ans[N] = 1
    for i in range(N-1,-1,-1):
        if a[i+1] and a[i+2]:
            ans[i] = (ans[i+1] + ans[i+2])
        elif a[i+1]:
            ans[i] = ans[i+1]
        else:
            ans[i] = ans[i+2]
    return ans[0]

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

hantei = False
a = [True] * (N+1) + [False]
for i in range(0,M-1,2):
    if A[i+1] - A[i] == 1:
        hantei = True
        break

ans = [1] * (N+1)
if not hantei:
    for i in range(M):
        a[A[i]] = False
    Answer = rec(0)

if hantei:
    print(0)
else:
    print(Answer%1000000007)
