N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [0]*N
dp[0] = 1
dp[1] = 2
for i in range(N-2):
    dp[i+2] = dp[i]+dp[i+1]

for i in range(M-1):
    if a[i+1] == a[i] + 1:
        print(0)
        break
else:
    if a[0] == 1:
        ans = 1
    else:
        ans = dp[a[0]-2]
    for i in range(M-1):
        if a[i+1]-a[i] >= 3:
            ans *= dp[a[i+1]-a[i]-3]
    if N-a[M-1]-2 >= 0:
        ans *= dp[N-a[M-1]-2] 
    print(ans%1000000007)