# 1 <= N <= 10 ** 5
# 0 <= M <= N − 1
# 1 <= a <= N - 1
import sys
sys.setrecursionlimit(10000)
N, M = map(int, input().split())

memo = {1: 1, 0: 1}
def fibo(n):
  if n in memo:
    return memo[n]
  else:
    num = fibo(n - 1) + fibo(n - 2)
    memo[n] = num
    return num


stairs = [False for _ in range(N + 1)]
pattern = 1
prev = 0
for _ in range(M):
  a = int(input())
  sub = a - prev - 1
  if sub == -1:
    print(0)
    break
  pattern *= fibo(sub)
  prev = a + 1
else:
  sub = N - prev
  pattern *= fibo(sub)

  print(pattern % 1000000007)
