import math
def fib(number):
    a, b = 0, 1
    for _ in range(number):
        a, b = b, a + b
    return b
N, M = map(int, input().split())
a = []
ans = 1
tmp = 0
for _ in range(M):
    a.append(int(input()))
for i in a:
    number = i-1-tmp
    if i == 1:
        tmp = 2
        continue
    else:
        if number<1:
            print(0)
            exit()
        else:
            ans *= fib(number)
            tmp = i+1
print((ans*fib(N-tmp))%1000000007)
