N,M,*as=$<.read.split.map(&:to_i)
mod=10**9+7
fib = [1,1]
2.upto(N) do |i|
    fib << fib[i-2]+fib[i-1]
end
prev = 0
ret = 1
as << N+1
as.each do |a|
    if prev == a
        puts 0
        exit
    end
    ret = ret * fib[a-prev-1]
    prev = a+1
end
puts ret%mod



# 1

# 1 1
# 2

# 1 1 1
# 1 2
# 2 1

# 1 1 1 1
# 1 1 2
# 1 2 1
# 2 1 1
# 2 2

# 1 1 1 1 1
# 1 1 1 2
# 1 1 2 1
# 1 2 1 1
# 2 1 1 1
# 2 2 1
# 2 1 2
# 1 2 2

# 1 1 1 1 1 1
# 1 1 1 1 2
# 1 1 1 2 1
# 1 1 2 1 1
# 1 2 1 1 1
# 2 1 1 1 1
# 1 1 2 2
# 1 2 1 2
# 1 2 2 1
# 2 1 1 2
# 2 1 2 1
# 2 2 1 1
# 2 2 2