parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	mod = 1000000007
	n,m = readline() |> split |> parseMap
	fib = Int[0,0]
	p = 1
	q = 1
	while p <= 100000
		push!(fib,p)
		temp = q
		q = p
		p = p+temp
	end
	a = Array{Int}(m+1)
	a[1] = -1
	for i in 1:m
		a[i+1] = readline() |> parseInt
	end
	push!(a,n+1)
	k = 1
	for i in 1:m+1
		if i==1&&a[2]==1
		else
			k = k*fib[a[i+1]-a[i]]%mod
		end
	end
	println(k)
end

main()