import sys
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
s=n-len(a)*2
S=[1,2]
for i in range(s):
    S.append((S[-1]+S[-2])%1000000007)

step=['00']+['1']*(n+1)
for i in range(m):
    step[a[i]+1]='0'
    step[a[i]+2]='0'
st=''.join(step)
#print(st)
st=st.split('00')
print(st)
ans=[]
if '0' in st:
    print(0)
    sys.exit()
else:
    for i in range(1,len(st)):
        ans.append(S[len(st[i])-1])
#print(ans)
p=1
for i in range(len(ans)):
    p*=ans[i]
print(p%1000000007)

