package main

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

var scanner = bufio.NewScanner(os.Stdin)

func next() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

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

func calc(n int) int {
	if n == 0 || n == 1 {
		return 1
	}

	if n == 2 {
		return 2
	}

	return calc(n-2) + calc(n-1)
}

func main() {
	scanner.Split(bufio.ScanWords)

	n := nextInt()
	m := nextInt()
	brokenSteps := nextInts(m)

	if n == 1 {
		fmt.Println(1)
		return
	}

	if n == 2 {
		if len(brokenSteps) == 0 {
			fmt.Println(2)
			return
		}
		fmt.Println(1)
		return
	}

	start := 0
	var answer uint64
	answer = 1
	for _, i := range brokenSteps {
		steps := i - start - 1
		if steps < 0 {
			fmt.Println(0)
			os.Exit(0)
		}
		answer *= uint64(calc(steps))
		start = i + 1
	}

	if start < n {
		steps := n - start
		answer *= uint64(calc(steps))
	}

	fmt.Println(answer % 1000000007)
}
