#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>

using namespace std;

/* PROBLEM

*/

/* INPUT

*/

/* OUTPUT

*/

long long M = 1000000007;

vector<long long> ways;

vector<bool> broken;

long long fill_ways(int index)
{
    if (ways[index] == -1)
        ways[index] = broken[index] ? 0 : (fill_ways(index-1) + fill_ways(index-2))%M;
    return ways[index];
}

int main(int argc, char const *argv[])
{
    
    int steps_amount, broken_amount;

    cin >> steps_amount >> broken_amount;

    ways.assign(steps_amount+1, -1);
    
    broken.assign(broken_amount+1, false);

    for (int i = 0; i < broken_amount; i++)
    {
        int j;
        cin >> j;
        broken[j] = true;
    }

    ways[0] = 1;
    
    ways[1] = broken[1] ? 0 : 1;

    cout << fill_ways(steps_amount) << "\n";

    return 0;
}