def fb(num):
    A, B = 1, 1
    for _ in range(num):
        A, B = A + B, A
    return B

N,M=map(int,input().split())
a=[]
for i in range(M):
    a.append(int(input()))
    if i > 0:
      if a[i-1]+1 == a[i]:
        print(0)
        quit()

p=0
ans=1
for i in range(M):
  ans*=fb(a[i]-p-1)
  p=a[i]
ans*=fb(N-p-1)
print(ans%1000000007)


