n,m=list(map(int,input().split()))

if n+1 < 2*m:
    print(0)
else:
    a = [int(input()) for _ in range(m)]

    pre2 = 0
    pre1 = 0
    cur = 1
    a_id = 0

    for i in range(n):
        pre2 = pre1
        pre1 = cur 
        cur = pre1 + pre2
        if i+1 == a[a_id]:
            a_id += 1 if a_id < m-1 else 0
            cur = 0
        if cur == 0 and pre1 == 0:
            break
    print(cur%1000000007)