import sys
n, m = map(int, input().split())
if m == 0:
    if n == 1:
        print(1)
    elif n == 2:
        print(2)
    else:
        fib = [1, 2]
        for j in range(n):
            fib.append(fib[j] + fib[j + 1])
        print(fib[n])
    sys.exit()

a = [int(input()) for i in range(m)]
a.insert(0, -1)
a.append(n + 1)

l = [a[i + 1] - a[i] for i in range(m + 1)]
error = 0
for i in range(m + 1):
    if l[i] == 1:
        error = 1
if error == 1:
    print(0)
    sys.exit()

ma = max(l) #ここまでFibを計算する
fib = [1, 1]
for j in range(ma):
    fib.append(fib[j] + fib[j + 1])
ans = 1
for i in range(len(l)):
    ans = ans * fib[(l[i] - 2)]
print(int(ans % 1000000007))