import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

N, M = map(int, input().split())
mod = 10 ** 9 + 7
a = [0] * M
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1

for i in range(M):
	a[i] = int(input())
	
now = 0
next = 0

for i in range(M):
	next = a[i]
	for j in range(now + 1, next + 1):
		if j == a[i]:
			dp[a[i]] = 0
		else:
			dp[j] = (dp[j - 1] + dp[j - 2]) % mod
	
	now = next

next = N
for j in range(now + 1, next + 1):
		dp[j] = (dp[j - 1] + dp[j - 2]) % mod
print(dp[N])