n,m=list(map(int,input().split()))
a=[int(input()) for i in range(m)]
n1,n2=1,0

for i in range(m-1):
  if a[i]+1==a[i+1]:
    print(0)
    exit()
  else:
    for j in range(1,n):
        if j in a:
            break
        else:
            if j-1 in a:
                n2=n1
            else:
                tmp=n1
                n1=n1+n2
                n2=tmp
    ans=n1%1000000007
    print(ans)