#include<bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define each(it,v) for(auto it : v)
#define mod 1000000007
#define vpii vector<pair<int,int>>

using namespace std;

int n,m,cnt;

main()
{
        cin>>n>>m;
        vpii p(n+10);
        p[0].second=1;
        each(&it,p)it.first=true;

        vi v(m);
        each(&it,v)
        {
                cin>>it;
                p[it].first=false;
        }

        rep(i,n)
        {
                if(!p[i].first)continue;

                p[i+1].second=(p[i+1].second+p[i].second%mod)%mod;
                p[i+2].second=(p[i+2].second+p[i].second%mod)%mod;
        }

        //debug
        //each(it,p)printf("%d %d %d\n",cnt++,it.first,it.second);

        cout<<p[n].second<<endl;
}
