n, m = map(int, input().split())

fib = [0]*n
fib[0] = 1
fib[1] = 1
for x in range(2, n):
    fib[x] = fib[x-1] + fib[x-2]

mod = 10**9+7
ans = 1
prev_a = -1
for i in range(m):
    a = int(input())
    if a - 1 == prev_a:
        ans = 0
        break
    else:
        ans = (ans * fib[a - prev_a - 2]) % mod
    prev_a = a

ans = (ans * fib[n - a - 1]) % mod
print(ans)