mod = 10**9+7
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]

def fib(n):
    if (n==1) or (n==2):
        return 1
    else:
        return fib(n-1)+fib(n-2)

start = 0
ans = 1

for k in a:
    tmp = k-start
    if tmp==0:
        print(0)
        exit(0)
    ans *= fib(tmp)
    ans%=mod
    start = k+1

ans*=fib(n-start+1)
ans%=mod

print(ans)