N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
def fibo(i):
    c, b = 1, 0
    while i > 0:
        c, b = c + b, c
        i -= 1
    return c
m = a[0] + 1
num = fibo(m - 2)
if M > 1 :
    for i in range(M - 1):
    m = a[i + 1] - a[i]
    if m > 1:
        num = num * fibo(m - 2)
    else:
        num = 0
        break
    num = num * fibo(N - a[M - 1] - 1)
elif M == 1:
    num = num * fibo(N - a[M - 1] - 1)
else :
    num = fibo(N)
print(num % 1000000007)
