def fib(n):
    n += 1
    if n == 0:
        return 1
    else:
        f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
        return int(f)

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

if M == 0:
    print(fib(N))
    exit()

A = [int(input()) for _ in range(M)]
L = [0] * (M+1)

ans = 1

L[0] = fib(A[0]-1)
L[M] = fib(N-(A[M-1]+1))

for i in range(1,M):
    if A[i]-A[i-1] == 1:
        print(0)
        exit()
    L[i] = fib((A[i]-1)-(A[i-1]+1))

for j in range(M+1):
    ans = (ans * L[j]) % (10**9 + 7)

print(ans)
