N, M = map(int, input().split())

def get_fib(x):
    fib = [1,1]
    for i in range(x-2):
        last2 = fib[-2:]
        fib.append(sum(last2))
    return fib

fib = get_fib(N)

a = 0
result = 1

if M == 0:
    result = fib[N-1]

for m in range(M):
    b = int(input())
    if b!=1 and b - a <= 1:
        result = 0
        break
    result += fib[b-a]
    a = b
    
mod = 1000000007
print(result%mod)