#!/usr/bin/env ruby
# require 'pry'

# dpテンプレ
# 最小化
# dp = Hash.new{ Float::INFINITY }
# dp[i] = [dp[i], dp[i-1] + hoge].min
# dp[0] = 0
# 最大化
# dp = Hash.new{ 0 }
# dp[i] = [dp[i], dp[i-1] + hoge].max
# dp[0] = 0

dp = {}
dp[0] = 0
n,m = gets.split(' ').map(&:to_i)
ary = Array.new(m) { gets.to_i }
ary.each{ |ele| dp[ele] = 0 }
if ary.include?(1) && ary.include?(2)
  dp[n] = 0
  puts 0
  exit
elsif ary.include?(1) && !ary.include?(2)
  dp[1] = 0
  dp[2] = 1
elsif !ary.include?(1) && ary.include?(2)
  dp[1] = 1
  dp[2] = 0
else
  dp[1] = 1
  dp[2] = 2
end

3.upto(n) do |i|
  next if dp[i]
  dp[i] = dp[i-1] + dp[i-2]
end

# p dp
puts dp[n] % 1_000_000_007
