# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	N, M = map(int, input().split(" "))
	N += 1
	a = []
	for i in range(M):
		tmp = int(input())
		tmp += 1
		a.append(tmp)
		if i != 0 and tmp == a[-1]+1:
			print(0)
			sys.exit()
			
	DP = [0 for i in range(N)]
	for i in range(N):
		if i == 0:
			DP[0] = 1
			continue
		if N-i in a:
			continue
		tmp = 0
		if i-1 >= 0:
			tmp = (tmp + (DP[i-1] % 1000000007)) % 1000000007
		if i-2 >= 0:
			tmp = (tmp + (DP[i-2] % 1000000007)) % 1000000007
		DP[i] = tmp
		
	#print(DP)
	print(DP[-1])
	
	
if __name__ == "__main__":
	main()
