#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

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

n,m=input2()
A=[int(input()) for _ in range(m)]
INF = 1000000007

start=0 #階段の開始点
ans=1 #
for a in A:
	tmp=a-start
	if tmp>1:
		fib=Fib(tmp+1)
		ans*=fib
		ans%=INF
	elif tmp==0:
		ans=0
		break
	start=a+1

if n-start>1:
	ans*=Fib(n-start+2)
	ans%=INF
print(ans) def input2():
	return map(int,input().split()) input2 return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def Fib(n):
	a,b=0,1
	if n==1:
		return a
	elif n==2:
		return b
	else:
		for i in range(n-2):
			a,b=b,a+b
		return b Fib a,b=0,1 a 0 b 1 if n==1:
		return a
	elif n==2:
		return b
	else:
		for i in range(n-2):
			a,b=b,a+b
		return b n==1 n 1 return a a elif n==2:
		return b
	 n==2 n 2 return b b for i in range(n-2):
			a,b=b,a+b
		 i range(n-2) range n-2 n 2 a,b=b,a+b a b b a+b a b return b b n n n,m=input2() n input2() input2 m int(input()) for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) int(input()) int input() input A=[int(input()) for _ in range(m)] A [int(input()) for _ in range(m)] INF = 1000000007 INF 1000000007 start=0 start 0 ans=1 ans 1 for a in A:
	tmp=a-start
	if tmp>1:
		fib=Fib(tmp+1)
		ans*=fib
		ans%=INF
	elif tmp==0:
		ans=0
		break
	start=a+1 a A tmp=a-start tmp a-start a start if tmp>1:
		fib=Fib(tmp+1)
		ans*=fib
		ans%=INF
	elif tmp==0:
		ans=0
		break
	 tmp>1 tmp 1 fib=Fib(tmp+1) fib Fib(tmp+1) Fib tmp+1 tmp 1 ans*=fib ans fib ans%=INF ans INF elif tmp==0:
		ans=0
		break
	 tmp==0 tmp 0 ans=0 ans 0 break start=a+1 start a+1 a 1 if n-start>1:
	ans*=Fib(n-start+2)
	ans%=INF n-start>1 n-start n start 1 ans*=Fib(n-start+2) ans Fib(n-start+2) Fib n-start+2 n-start n start 2 ans%=INF ans INF print(ans) print ans def input2():
	return map(int,input().split()) def input2():
	return map(int,input().split()) input2 ans=0 0 ans m=input2() input2() m INF = 1000000007 1000000007 INF start=0 0 start ans*=Fib(n-start+2) Fib(n-start+2) ans ans%=INF INF ans def Fib(n):
	a,b=0,1
	if n==1:
		return a
	elif n==2:
		return b
	else:
		for i in range(n-2):
			a,b=b,a+b
		return b def Fib(n):
	a,b=0,1
	if n==1:
		return a
	elif n==2:
		return b
	else:
		for i in range(n-2):
			a,b=b,a+b
		return b Fib A=[int(input()) for _ in range(m)] [int(input()) for _ in range(m)] A ans=1 1 ans start=a+1 a+1 start ans*=fib fib ans tmp=a-start a-start tmp fib=Fib(tmp+1) Fib(tmp+1) fib n,m=input2() input2() n ans%=INF INF ans
#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

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

n,m=input2()
A=[int(input()) for _ in range(m)]
INF = 1000000007

start=0 #階段の開始点
ans=1 #
for a in A:
	tmp=a-start
	if tmp>1:
		fib=Fib(tmp+1)
		ans*=fib
		ans%=INF
	elif tmp==0:
		ans=0
		break
	start=a+1

if n-start>1:
	ans*=Fib(n-start+2)
	ans%=INF
print(ans)