n,m = map(int, input().split())

def a(n):
    if n==-1:
        return 0
    elif n==0:
        return 1
    elif n == 1:
        return 1
    elif n== 2:
        return 2
    else:
        return a(n-1)+a(n-2)

ans = 1
ls = [-1]
for _ in range(m):
    ls.append(int(input()))
ls.append(n+1)
ms = []
for i in range(m+1):
    t = ls[i+1]-ls[i]-2
    ms.append(t)
for j in ms:
    ans *= a(j)
ans = ans %1000000007
print(ans)