package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc *bufio.Scanner = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}()

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = nextInt()
	}
	return ints
}

const divisor = 1000000007

type brokenIndexes map[int]struct{}

func (bi *brokenIndexes) add(key int) {
	(*bi)[key] = struct{}{}
}

func countWays(stairNum int, bi brokenIndexes) int {
	counts := make([]int, stairNum+1)
	counts[0] = 1
	counts[1] = returnStairs(1, 1, bi)
	for i := 2; i < stairNum+1; i++ {
		stairs := counts[i-1] + counts[i-2]
		if stairs == 0 {
			return 0
		}
		counts[i] = returnStairs(i, stairs, bi)
	}
	return counts[stairNum] % divisor
}

func returnStairs(index, value int, bi brokenIndexes) int {
	if _, ok := bi[index]; ok {
		return 0
	}
	return value
}

func main() {
	n, m := nextInt(), nextInt()
	bi := make(brokenIndexes, m)
	for i := 0; i < m; i++ {
		bi.add(nextInt())
	}
	r := countWays(n, bi)
	fmt.Println(r)
}
