import bisect
mod = 1000000007

n, m = list(map(int, input().split()))
nums = [int(input()) for _ in range(m)]
 
dp = [1] + [0 for _ in range(n)]

if nums[0] != 1:
	dp[1] = 1
	idx = bisect.bisect_right(nums, 1)
	nums = nums[idx:]

for i in range(2, n + 1):
	if i in nums:
		dp[i] = 0
		idx = bisect.bisect_right(nums, 1)
		nums = nums[idx:]
	else:
		dp[i] = (dp[i - 1] + dp[i - 2])  % mod

print(dp[-1])

