from functools import lru_cache
@lru_cache(maxsize=1000)
def fib(n):
	if n < 2:
		return n
	else:
		return fib(n - 1) + fib(n - 2)



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

a.append(n)

b = []
for i in range(n+1):
	b.append(fib(i))
	
c = []
#if a[1] == 0:
	#c.append(1)
#else:
	#c.append(b[a[1] - a[0] ])
	
	
i = 0
while i <= m + 1:
	if a[i + 1] - a[i] - 2 >= 0:
		c.append(b[a[i + 1] - a[i]  - 2])
		i += 1
	#elif a[i + 1] - a[i] - 2 == 0:
		#c.append(1)
	else:
		c.append(0)
		break
#print(c)
d = c[0] 
i = 1
#print(d)
while i < len(c):
	d = d * c[i]
	i += 1

e = 1000000007
print(d % e)
#print(b[0])