n, m = map(int, input().split())
hoge = []
for i in range(0,m):
	a = int(input())
	hoge.append(a)
hoge2 = hoge[1:]

import functools
import operator

def fib(n):
	a, b = 0, 1
	for i in range(n):
		a, b = b, a + b
	return b
if m == 1:
	print(fib(hoge[0]-1)*fib(n-hoge[0]-1))
else:
	hogex = [x - y for (x, y) in zip(hoge2, hoge[:-1])]

	if 1 in hogex:
		print(0)
	else:
		hoger = [hoge[0]] + hogex
		hogem = list(map(lambda x: x -2,hoger))
		fibli = list(map(fib,hogem))
		res = functools.reduce(operator.mul, fibli) % 1000000007
	print(res)