var lines = [];
var MOD = 1000000007

var N, M
var a
var memo
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    N = Number(lines[0].split(" ")[0]);
    M = Number(lines[0].split(" ")[1]);
    lines.shift();

    a = Array(N+1).fill(0)
    for (var i = 0; i < M; i++) {
        var t = Number(lines[i]);
        a[t] = 1
    }
    memo = Array(N).fill(0)
    console.log(dfs(0));

});

function dfs(n) {
    if (N < n || a[n] === 1) { return (0) }
    if (memo[n]) { return (memo[n]) }
    if (n === N) { return (1) }
    else {
    
        var res = 0;
        if (memo[n + 1]) { res += memo[n + 1] }
        else { res += dfs(n + 1); }
        res %= MOD;

        if (memo[n + 2]) { res += memo[n + 2] }
        else { res += dfs(n + 2); }
        res %= MOD;
    }
    memo[n] = res
    return (memo[n])
}
