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

check = [1]*(n)
check.append(0)
check.append(0)
be = int(input())
check[be-1] = 0
check[be-2] = 2
for i in range(m-1):
    a = int(input())
    if a == be+1:
        print(0)
        exit()
    else:
        check[a-1] = 0
        check[a-2] = 2
        be = a
        

count = [0]*(n+2)

mod = 10**9+7
if check[0]==1:
    count[0] = 1
    count[1] = 2
elif count[0] == 0:
    count[1] = 1

for i in range(1,n-1):
    if check[i+1] == 0:
        count[i+2] = count[i]%mod
    else:
        if check[i+1] == 1 or check[i+1] == 2:
            count[i+1] += count[i]%mod
        if check[i+2] == 1 or check[i+2] == 2:
            count[i+2] += count[i]%mod
    
print(count[n-1]%mod)