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