n,m=map(int,input().split())
l=[]
for i in range(m):
    l.append(int(input()))
if not 1 in l:
    two=1
if not 2 in l:
    if two==1:
        one=2
    else:
        one=1
lis=[two,one]
for _ in range(3,n+1):
    if not _ in l:
        lis.append((lis[_-3]+lis[_-2])%1000000007)
    else:
        lis.append(0)
print(lis[-1])