n,m=map(int, input().split())
a = [int(input()) for _ in range(m)]
if 1 in a:
    ans = [0,1]
elif 2 in a:
    ans = [1,0]
else:
    ans = [1,2]
for i in range(2,n):
    if i+1 not in a:
        ans.append(ans[i-1]+ans[i-2])
    else:
        ans.append(0)
print(ans[len(ans)-1]%1000000007)
    