def solve(n):
  if n <= 1:
    ans = 1
  elif n == 2:
    ans = 2
  else:
    ans = solve(n-1) + solve(n-2)
  return ans

n,m=map(int, input().split())
a=[0]
ans = 1
for i in range(0,m):
  a = a+[int(input())]
  if a[i+1] - a[i] == 1 and i > 1:
    ans = 0
a = a + [n+1]

memo = [1, 1]
for i in range(2, 10000):
  memo = memo + [memo[i-1] + memo[i-2]]

for i in range(0,m+1):
  if a[i+1] - a[i] != 1:
    ans = (ans * memo[a[i+1] - a[i] - 2]) % 1000000007
print(ans)

