n,m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))
fib = [1,1]
#n段登る場合の数がfib[n]になるようにする
for i in range(n):
    fib.append((fib[i]+fib[i+1])%1000000007)
answer = 1
answer *= fib[a[0]-1]
if m > 1:
    if a[0]+1 == a[1]:
        answer = 0
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        answer = 0
    answer = answer * fib[a[i+1]-a[i]-2] % 1000000007
answer = answer * fib[n - a[m-1] -1] % 1000000007
print(answer)