#C問題
N,M = map(int,input().split())
a = []
for i in range(M):
    a.append(int(input()))
    
fibo = []
for i in range(N):
    if i == 0:
        fibo.append(1)
    elif i == 1:
        fibo.append(2)
    else:
        fibo.append(fibo[-1]+fibo[-2])
    
lens = []
nowlen = 1
for i in range(N):
    if i+1 in a:
        if nowlen != 1:
            lens.append(nowlen-1)
        else:
            lens.append(nowlen)
        nowlen = 0
    else:
        nowlen+=1
        
lens.append(nowlen-1)

lenlens = len(lens)
count = 1
for i in range(lenlens):
    if i == 0 and lens[i] == 0:
        pass
    else:
        ll = lens[i]
        if ll == 0:
            count*=0
        else:
            count*=fibo[lens[i]-1]

print(count%1000000007)