import sys
def input(): return sys.stdin.readline().strip()

def main():
    n,m=map(int,input().split())
    if n == 1:
        print(1)
        return
    aa=[]
    for _ in range(m):
        aa.append(int(input()))
    for i in range(m-1):
        if aa[i]+1==aa[i+1]:
            print(0)
            return
    cc = [0] * n
    i = 0
    j = 2 
    cc[0] = 1
    if aa[0] > 1:
        cc[1] = 1
    else:
        cc[1] = 0
        i += 1
    while j < n:
        if i < m and aa[i] == j:
            i+=1
        else:
            cc[j]=cc[j-1]+cc[j-2]
        j+=1
    print((cc[n-1]+cc[n-2])%1000000007)

main()