package main

import (
	"fmt"
)

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

func fib(n int) int {
	f1 := 1
	f2 := 1
	temp := 1
	ans := 0
	if n <= 2 {
		if n == 1 {
			return 1
		}
		return 2
	}
	for i := 3; i <= n; i++ {
		ans += f1 + f2
		temp = f2
		f2 = f1
		f1 = temp + f1
	}
	return ans
}

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))
	}
}