'use strict'
function main(input) {
    const tmp = Array.from(input.split('\n'));
    const NM = tmp.shift().split(' ').map((elem) => parseInt(elem), 10);
    const N = NM[0];
    const M = NM[1];

    const mod = 1000000007;
    const A = tmp.map((elem) => parseInt(elem, 10));
    let dp = Array(N + 1).fill(0);
    for (let a of A) {
        dp[a] = -1;
    }
    dp[0] = 1;

    for (let i = 0; i < N; i++) {
        if (dp[i] === -1) {
            continue;
        }
        if (dp[i + 1] !== -1) {
            dp[i + 1] += dp[i];
            dp[i + 1] %= mod;
        }
        if (dp[i + 2] !== -1) {
            dp[i + 2] += dp[i];
            dp[i + 2] %= mod;
        }


    }
    console.log(dp[N]);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));