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

fib_memo = {}
def fib(n):
    if n < 3: return 1
    if n not in fib_memo:
        fib_memo[n] = fib(n-1) + fib(n-2)
    return fib_memo[n]

now = 0
count = 1
for i in a:
    count *= fib(i-now)
    if now != 0 and now+1 == i:
        print(0)
        quit()
    now = i+1

count *= fib(N-now+1)

mod = 7+10**9
print(count%mod)