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

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

fib = get_fib(N+1)

a = 1
mod = 10 ** 9 + 7
result = 1

for m in range(M):
    b = int(input())
    if b == 1:
        a = b + 1
        continue
    elif b == a:
        result = 0
        break

    result *= fib[b-a]
    result = result % mod
    a = b + 1

result *= fib[(N)-a]
result = result % mod

print(result)