n, m=map(int, input().split())
def fb(n):    
  if n == 1:
    return 1
  elif n == 2:
    return 2
  else:
    return fb(n-1) + fb(n-2)
#print(fb(4))
l=[]
for _ in range(m):  
  l.append(int(input()))
ans=fb(l[0]-1)
#print(ans)

for i in range(m-1):
  if l[i]+1==l[i+1]:
    print(0)
    exit()
  elif l[i+1]-l[i]>2:
    ans=ans*(fb(l[i+1]-l[i]-1))
print(ans*fb(n-l[m-1]-1)%1000000007)
