function Main(input) {
    input = input.trim().split("\n");
    tmp = input[0].split(" ");
    var N = parseInt(tmp[0],10);
    var M = parseInt(tmp[1],10);
    var a = [];
    var isFirstBreak = false;
    var isSecondBreak = false;
    for(var i = 0; i < M; i++){
        a[i] = parseInt(input[i+1],10);
        if(a[i] == 1){
            isFirstBreak = true;
        }
        else if(a[i] == 2){
            isSecondBreak = true;
        }
    }
    var step = [];
    if(isFirstBreak){
        step[0] = 0;
    }
    else{
        step[0] = 1;
    }
    if(isSecondBreak){
        step[1] = 0;
    }
    else{
        step[1] = 1 + step[0];
    }
    for(var i = 2; i < N; i++){
        var isBreak = false;
        for(var j = 0; j < M; j++){
            if(a[j] == i+1){
                isBreak = true;
            }
        }
        if(isBreak){
            step[i] = 0;
        }
        else{
            step[i] = (step[i-1] + step[i-2])%1000000007;
        }
    }
    var output = step[N-1];
    console.log(output);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));