n,m=map(int,input().split())
b=[]
b_clone=[]

for i in range(m):
    t=int(input())
    b.append(t)
    b_clone.append(t)


ans_list=[1]

if len(b)!=0 and b[0]==1:
    b.pop(0)
    ans_list.append(0)
else:
    ans_list.append(1)

for i in range(2,n+1):
    if len(b)!=0 and i==b[0]:
        b.pop(0)
        ans_list.append(0)
        continue
    else:
        ans_list.append((ans_list[i-2]+ans_list[i-1])%1000000007)

print(ans_list)

print(ans_list[n])
