#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define FastIO ios::sync_with_stdio(0); cin.tie(0);

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pair<ll, ll>> vpl;
typedef map<ll, ll> mll;
typedef map<string, ll> msl;
#define md 1000000009

void minn(ll &a, ll b)
{
    a = min(a,b);
}

void maxx(ll &a, ll b)
{
    a = max(a,b);
}

void mod(ll &a)
{
    if(a>=md)
    {
        a -= md;
    }
}

vl dp;
vector<bool> stair;

ll f(ll a)
{
    if(a < 0 or !stair[a])
    {
        return 0;
    }
    if(a == 0)
    {
        return 1;
    }
    if(dp[a] != -1)
    {
        return dp[a];
    }
    dp[a] = f(a-1) + f(a-2);
    mod(dp[a]);
    return dp[a];
}

int main()
{
    FastIO
    ll n, m; cin >> n >> m;
    dp.resize(n+1,-1);
    stair.resize(n+1,true);
    for (int i = 0; i < m; i++)
    {
        ll x; cin >> x;
        stair[x] = false;
    }

    cout << f(n) << '\n';
    
    return 0;
}