n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [a[0]-1] + [a[i+1]-a[i]-2 for i in range(m-1)] + [n-a[m-1]-1]
c = [1,1]+[0]*(n-1)
for i in range(2,n+1):
  c[i] = c[i-1] + c[i-2]
ans = 1
for j in b:
  if j == -1:
    ans = 0
    break
  ans = ans * c[j] %1000000007
print(ans)