N,M = map(int, input().split())
brk = []
for h in range(0,M):
    brk.append(int(input()))
flt = [0]
put = [1]
for i in range(1,N+1):
    if i in brk:
        flt.append(put[i-1])
        put.append(0)
    else:
        flt.append(put[i-1])
        put.append(put[i-1]+flt[i-1])
A = put[N] % 1000000007
print(A)