#C問題
N,M = map(int,input().split())
a = []
for i in range(M):
    a.append(int(input()))
    
way = []
for i in range(N+1):
    if i == 0:
        way.append(0)
    elif i == 1:
        way.append(1)
    else:
        way.append(way[i-1]+way[i-2])
    
ans = 1
now = 0
for i in range(N):
    if (i+1) in a:
        if now == 0 and i != 0:
            ans = 0
            break
        elif i == 0:
            pass
        else:
            ans*=way[now]
            now = 0
    else:
        now+=1
ans*=way[now]
print(ans%1000000007)