package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func fib(i int) int {
	a := []int{1, 1}
	j := 2
	for ; j < i; j += 2 {
		a[j%2] += a[(j+1)%2]
		a[(j+1)%2] += a[j%2]
	}
	return a[(i+1)%2]
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	m := nextInt()
	var ary = make([]int, m)
	for i := 0; i < m; i++ {
		ary[i] = nextInt()
	}

	ret := 0
	if m > 0 {
		ret += fib(ary[0])
		for i := 1; i < m; i++ {
			if ary[i-1]+1 == ary[i] {
				ret = 0
				break
			}
			ret *= fib(ary[i] - ary[i-1] - 1)
		}
		ret *= fib(n - ary[m-1])
	} else {
		ret += fib(n + 1)
	}

	div := 1000000007
	fmt.Println(ret % div)
}
