package main

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

const Inf = 1000000007

func main() {
	var N, M int
	fmt.Scanf("%d %d", &N, &M)
	sc := bufio.NewScanner(os.Stdin)
	A := make([]int, M)
	for i := 0; i < M; i++ {
		sc.Scan()
		v, _ := strconv.Atoi(sc.Text())
		A[i] = v
	}

	ptr := 0

	houhou := make([]int, N+1)
	houhou[0] = 1
	if ptr < M {
		if A[ptr] == 1 {
			ptr++
		} else {
			houhou[1] = 1
		}
	}

	for i := 2; i < N+1; i++ {
		if ptr < M {
			if A[ptr] == i {
				ptr++
				continue
			} else {
			}
		}
		houhou[i] = (houhou[i-1] + houhou[i-2]) % Inf
	}

	fmt.Println(houhou[N])
}
