N, M = map(int, input().split())
m = [int(input()) for k in range(M)]
dic = {}
for n in range(N):
    dic[n]=[n+1 in m, n+2 in m]
ndic = {0:1}
for n in range(N):
    if not n+1 in m:
        if n+1 in ndic.keys():
            ndic[n+1] += ndic[n]
        else:
            ndic[n+1] = ndic[n]
#         print("add {} to {}".format(ndic[n], n+1))
    else:
        if not n+2 in ndic.keys():
            ndic[n+1] = 0
    if not  n+2 in m:
        if n+2  in ndic.keys():
            ndic[n+2]+= ndic[n]
        else:
            ndic[n+2]= ndic[n]
    else:
        if not n+2 in ndic.keys():
            ndic[n+2] = 0
#         print("add {} to {}".format(ndic[n],n+2 ))

print(ndic[N]%1000000007)
