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

li = [0]*10**5
lia = [-1]
ans = 1
mod = 1000000007

for i in range(n):
    if i == 0:
        li[i] = 1
    elif i == 1:
        li[i] = 1
    else:
        li[i] = li[i-1] + li[i-2]

for i in range(m):
    a = int(input())
    lia.append(a)

lia.append(n+1)

for i in range(len(lia)-1):
    if lia[i+1]-lia[i] != 1:
        ans *= li[lia[i+1]-lia[i]-2]
    else:
        if lia[i] == 0 or lia[i+1] == n:
            pass
        else:
            ans = 0
    ans %= mod

print(ans%mod)
