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

for n, i in enumerate(a):
    if n > 0:
        if (a[n] - a[n-1]) == 1:
            print(0)
            exit()

def search(i, n):
    if i in a:
        return 0
    if i == n:
        return 1
    if i > n:
        return 0
    return search(i+1, n) + search(i+2, n)

ans = 1
start = 0
a.append(N+1)
for num in a:
    ans *= search(start, num-1)
    for i in range(1, N):
        start = num + i
        if start not in a:
            break

print(ans%1000000007)