"use strict";
const main = input => {
    let n = parseInt(input[0].split(' ')[0],10), m = parseInt(input[0].split(' ')[1],10);
    let arr = new Array(n+1),a=0;
    arr[0] = 1,arr[1] = 1;
    for(let i=0; i<m; i++) {
        a = parseInt(input[i+1],10);
        arr[a] = 0;
    }
    for(let i=2; i<n+1; i++) {
        if (arr[i]!=0) {
            arr[i] = (arr[i-1]+arr[i-2])%1000000007;
        }
    }
    // console.log(arr);
        
    console.log(arr[n]);
    
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));