package main

import (
	"fmt"
)

func product(l []int) int {
	s := 1
	for _, x := range l {
		s *= x
	}
	return s
}

func fib(n int) int {
	if n < 2 {
		return 1
	}
	return fib(n-2) + fib(n-1)
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	a := make([]int, m+2)
	a[0] = -1
	for i := 1; i <= m; i++ {
		fmt.Scan(&a[i])
	}
	a[m+1] = n + 1
	d := make([]int, m+1)
	for i := 0; i < m+1; i++ {
		d[i] = a[i+1] - a[i] - 2
	}
	if contains(d, -1) {
		fmt.Println(0)
	} else {
		for i := 0; i < m+1; i++ {
			d[i] = fib(d[i])
		}
		fmt.Println(product(d) % 1000000007)
	}
}
