import sys
input = sys.stdin.readline

n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
F = [1]*(n+3)
for i in range(2,n+1):
    F[i]=(F[i-1]%(10**9+7)+F[i-2]%(10**9+7))%(10**9+7)


if n==1:
    print(1)
elif n==2:
    if m==1:
        print(1)
    elif m==0:
        print(2)
else:
    for i in range(m):
        if a[i]+1 in a or a[i]-1 in a:
            print(0)
            exit()
    if m==0:
        print(F[n])
    else:
        x=F[min(a)-1]
        a.append(n+1)
        for i in range(1,len(a)):
            x=(x*F[a[i]-a[i-1]-2])%(10**9+7)
        print(x)
