n,m = (int(i) for i in input().split())
a = [-1]

for i in range(m):
    a.append(int(input()))
a .append(n+1)
fibo = [1,2,3]
for i in range(n-2):
    fibo.append(fibo[-1]+fibo[-2])
ans = 1
start =0
if(a[1]==1):
    start =1
for x in range(start,m+1):
    if(abs(a[x+1]-a[x])==1):
       ans = 0
    else:
       ans *= fibo[a[x+1]-a[x]-3]
print(ans%1000000007)
