n,m = map(int,input().split())
a = [int(input())-1 for i in range(m)]
dp = [0]*n
if n==1:
    if 0 in a:
        print(0)
        exit()
    else:
        print(1)
        exit()
if 0 in a:
    if 1 in a:
        print(0)
        exit()
    else:
        dp[0]=0
        dp[1]=1
else:
    if 1 in a:
        dp[0]=1
        dp[1]=0
    else:
        dp[0]=1
        dp[1]=2
for i in range(2,n):
    if i in a:
        continue
    if i-1 in a and i-2 in a:
        print(0)
        exit()
    x = dp[i]
    y = dp[i-1]
    z = dp[i-2]
    elif i-1 in a:
        x=z
    elif i-2 in a:
        x=y
    else:
        x= y+z
        if x>=10**9+7:
            x-=(10**9+7)
print(dp[n-1])
