def Fib(n):
  a, b = 1, 1
  if n == 0:
  	return a
  elif n == 1:
    return b
  else:
    for i in range(n-2):
      a, b = b, a + b
    return b

mod = 1000000007
def mul(a, b):
  return ((a % mod) * (b % mod)) % mod

def power(x, y):
  if   y == 0     : return 1
  elif y == 1     : return x % mod
  elif y % 2 == 0 : return power(x, y/2)**2 % mod
  else            : return power(x, y/2)**2 * x % mod

def div(a, b):
  return mul(a, power(b, mod-2))
  
N, M = map(int, input().split())
a = int(input())
ret = mul(1, Fib(a))
pre_a = a

for i in range(M-1):
  a = int(input())
  if a - pre_a <= 1:
    ret = 0
    break
  else:
    num_step = a - pre_a - 1
    ret = mul(ret, Fib(num_step))
  pre_a = a
    
num_step = N - a
ret = mul(ret, Fib(num_step))
print(ret)
