package main

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

func main() {
	var n,m int
	fmt.Scan(&n,&m)

	a := make([]int,m)
	for i := 0; i < m; i++ {
		a[i] = scanInt()
	}

	s := make([]int,n)
	s[0] = 1
	s[1] = 1
	p := 0
	for i := 0; i < n; i++ {
		if p < m {
			if a[p] == i+1 {
				s[i] = 0
				p++
			}
		}
		
		if i+1 < n {
			s[i+1] = (s[i+1] + s[i]) %1000000007
		}

		if i+2 < n {
			s[i+2] = (s[i+2] + s[i]) %1000000007
		}
	}

	fmt.Println(s[len(s)-1])
}

var sc = bufio.NewScanner(os.Stdin)
func scanInt() int {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return a
}
