stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod=1e9+7;

int main()

{

    bool vis[100009]={};

    ll a[100009]={1,1,2};

    ll n,k,x;

    cin>>k>>n;

    for(int i=1;i<=n;i++)

    {

        cin>>x;

        vis[x]=true;

    }

    for(int i=1;i<=k;i++)

    {

        if(vis[i]) a[i]=0;

        else a[i]=(a[i-1]%mod+(i>=2?a[i-2]:0)%mod)%mod;

    }

    cout<<a[k];

}


// Faster C++ solution for the same problem (measured speedup: 1.9093959160711051x):
#include <bits/stdc++.h>



using ll = long long;

using namespace std;



const int MAX { 100010 };

ll MOD { 1000000007 };



bitset<MAX> trap;

ll dp[MAX];



ll solve(int N) {

    //Casos bases

    dp[0] = 1;

    dp[1] = (trap[1] ? 0 : 1);



    for (int i = 2; i <= N; i++) {



        //Se o degrau estiver quebrado existem 0 maneiras de se chegar até ele

        if (trap[i]) {

            dp[i] = 0;

        } else {

            //Se não houver o armadilha a quantidade de maneiras de se chegar até 

            //a esse degrau é o total de maneiras vindo de dp[i-2] + dp[i-1]

            dp[i] = (dp[i-2] + dp[i-1]) % MOD;

        }

    }

    return dp[N];

}



int main(int argc, char const *argv[])

{

    int N, M, t;

    cin >> N >> M;



    for (int i = 0; i < M; i++) {

        cin >> t;

        trap[t] = true;

    }



    auto ans = solve(N);



    cout << ans << '\n';



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define MAX_V 100005



using namespace std;

typedef long long ll;



const int mod = 1e9 + 7;



int cannot_setfoot[MAX_V];

int dp[MAX_V];

int n, m;



int backtrack(int i)

{

    if (i > n)

        return 0;

    else if (i == n)

        return 1; 

    else if (cannot_setfoot[i])

        return 0;

    else if (dp[i] != -1)

        return dp[i];

    return (dp[i] = (backtrack(i+1) + backtrack(i+2)) % mod);

}



int main()

{

    FAST_IO;

    cin >> n >> m;

    memset(dp, -1, sizeof(dp));

    for (int i = 0; i < m; i++) {

        int x;

        cin >> x;

        cannot_setfoot[x] = 1;

    }

    cout << backtrack(0) << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4156190412995457x):
#include <bits/stdc++.h>



using ll = long long;

using namespace std;



const int MAX { 100010 };

ll MOD { 1000000007 };



bitset<MAX> trap;

ll dp[MAX];



ll solve(int N) {

    //Casos bases

    dp[0] = 1;

    dp[1] = (trap[1] ? 0 : 1);



    for (int i = 2; i <= N; i++) {



        //Se o degrau estiver quebrado existem 0 maneiras de se chegar até ele

        if (trap[i]) {

            dp[i] = 0;

        } else {

            //Se não houver o armadilha a quantidade de maneiras de se chegar até 

            //a esse degrau é o total de maneiras vindo de dp[i-2] + dp[i-1]

            dp[i] = (dp[i-2] + dp[i-1]) % MOD;

        }

    }

    return dp[N];

}



int main(int argc, char const *argv[])

{

    int N, M, t;

    cin >> N >> M;



    for (int i = 0; i < M; i++) {

        cin >> t;

        trap[t] = true;

    }



    auto ans = solve(N);



    cout << ans << '\n';



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



const int mod = 1e9 + 7;

int broken[100005], mem[100005];

int n;

int solve(int ind){

    if(ind == n) return 1;

    if(ind > n) return 0;

    if(broken[ind]) return 0;

    int &ret = mem[ind];

    if(~ret) return ret;

    return ret = (solve(ind + 1) + solve(ind + 2)) % mod;

}

int main() {

#ifndef ONLINE_JUDGE

    //freopen("input.txt", "r", stdin);

#endif

    memset(mem, -1, sizeof(mem));

    int m;

    scanf("%d%d", &n, &m);

    for(int i=0; i<m;i++){

        int cur;

        scanf("%d", &cur);

        broken[cur] = true;

    }

    printf("%d\n", solve(0));

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4098113895338602x):
#include <bits/stdc++.h>



using namespace std;



int n, m, whi;

bool bro[100005];

int dp[100010];



int main()

{

    scanf("%d%d", &n, &m);

    for(int i = 0; i < m; i ++)

    {

        scanf("%d", &whi);

        bro[whi] = 1;

    }

    dp[0] = 1;

    for(int i = 0; i <= n; i ++)

    {

        //cout<<dp[i]<<' ';

        if(bro[i]) continue;

        dp[i + 1] += dp[i];

        dp[i + 1] %= 1000000007;

        dp[i + 2] += dp[i];

        dp[i + 2] %= 1000000007;

    }

    printf("%d", dp[n]);

    //system("pause");

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod=1e9+7;

int main()

{

    bool vis[100009]={};

    ll a[100009]={1,1,2};

    ll n,k,x;

    cin>>k>>n;

    for(int i=1;i<=n;i++)

    {

        cin>>x;

        vis[x]=true;

    }

    for(int i=1;i<=k;i++)

    {

        if(vis[i]) a[i]=0;

        else a[i]=(a[i-1]%mod+(i>=2?a[i-2]:0)%mod)%mod;

    }

    cout<<a[k];

}


// Faster C++ solution for the same problem (measured speedup: 1.9318553881097538x):
#include <bits/stdc++.h>



using namespace std;



int n, m, whi;

bool bro[100005];

int dp[100010];



int main()

{

    scanf("%d%d", &n, &m);

    for(int i = 0; i < m; i ++)

    {

        scanf("%d", &whi);

        bro[whi] = 1;

    }

    dp[0] = 1;

    for(int i = 0; i <= n; i ++)

    {

        //cout<<dp[i]<<' ';

        if(bro[i]) continue;

        dp[i + 1] += dp[i];

        dp[i + 1] %= 1000000007;

        dp[i + 2] += dp[i];

        dp[i + 2] %= 1000000007;

    }

    printf("%d", dp[n]);

    //system("pause");

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define MAX_V 100005



using namespace std;

typedef long long ll;



const int mod = 1e9 + 7;



int cannot_setfoot[MAX_V];

int dp[MAX_V];

int n, m;



int backtrack(int i)

{

    if (i > n)

        return 0;

    else if (i == n)

        return 1; 

    else if (cannot_setfoot[i])

        return 0;

    else if (dp[i] != -1)

        return dp[i];

    return (dp[i] = (backtrack(i+1) + backtrack(i+2)) % mod);

}



int main()

{

    FAST_IO;

    cin >> n >> m;

    memset(dp, -1, sizeof(dp));

    for (int i = 0; i < m; i++) {

        int x;

        cin >> x;

        cannot_setfoot[x] = 1;

    }

    cout << backtrack(0) << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4322704104618236x):
#include <bits/stdc++.h>



using namespace std;



int n, m, whi;

bool bro[100005];

int dp[100010];



int main()

{

    scanf("%d%d", &n, &m);

    for(int i = 0; i < m; i ++)

    {

        scanf("%d", &whi);

        bro[whi] = 1;

    }

    dp[0] = 1;

    for(int i = 0; i <= n; i ++)

    {

        //cout<<dp[i]<<' ';

        if(bro[i]) continue;

        dp[i + 1] += dp[i];

        dp[i + 1] %= 1000000007;

        dp[i + 2] += dp[i];

        dp[i + 2] %= 1000000007;

    }

    printf("%d", dp[n]);

    //system("pause");

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

using namespace std;

typedef long long ll;





int main(void){

  int n,m,i,a;

  ll dp[100005]={};

  const int mod=1e9+7;

  

  cin >> n >> m;

  for (i=0;i<m;i++){

    cin >> a;

    dp[a]=-1;

  }

  

  dp[0]=1;

  if (dp[1]==0) dp[1]=1;

  for (i=2;i<=n;i++){

    if (dp[i]!=-1){

      if (dp[i-2]>0) dp[i]=(dp[i]+dp[i-2])%mod;

      if (dp[i-1]>0) dp[i]=(dp[i]+dp[i-1])%mod;

    }

  }

  

  cout << dp[n] << endl;

  

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.2965092066129345x):
#include <iostream>

#include <algorithm>

using namespace std;

typedef long long ll;





int main(void){

  int n,m,i,a,dp[100005]={};

  const int mod=1e9+7;

  

  cin >> n >> m;

  for (i=0;i<m;i++){

    cin >> a;

    dp[a]=-1;

  }

  

  dp[0]=1;

  for (i=1;i<=n;i++){

    if (dp[i]==0){

      if (i-2>=0 && dp[i-2]>=0) dp[i]=(dp[i]+dp[i-2])%mod;

      if (dp[i-1]>=0) dp[i]=(dp[i]+dp[i-1])%mod;

    }

  }

  

  cout << dp[n] << endl;

  

  return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<string>

#include<iostream>

#include<algorithm>

#include<queue>

#include<math.h>

#include<vector>

#include<map>

using namespace std;

#define ll long long

int mod=1e9+7;

int main()

{

    int n,m;

    while(~scanf("%d%d",&n,&m))

    {

        int a[100005];

        memset(a,0,sizeof(a));

        for(int i=0; i<m; i++)

        {

            int x;

            scanf("%d",&x);

            a[x]=-1;

        }

        a[0]=1;

        for(int i=1; i<=n; i++)

        {

            if(a[i]==-1)

                a[i]=0;

            else

            {

                if(i>=2)

                {

                    a[i]=a[i-1]%mod+a[i-2]%mod;

                }

                else

                {

                    a[i]=a[i-1]%mod;

                }

                a[i]%=mod;

            }

        }

        printf("%d\n",a[n]);

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4023703779974042x):
#include <bits/stdc++.h>



using namespace std;

const int N=2e5+5,mod=1e9+7;

#define ll long long

bool broken[N];

int a[N];

int main()

{

    ios_base::sync_with_stdio(0);

    cin.tie(0);cout.tie(0);

    int n,m;

    cin>>n>>m;

    for(int i=0;i<m;i++)

    {

        int x;

        cin>>x;

        broken[x]=1;

    }

    a[0]=1;

    for(int i=1;i<=n;i++)

    {

        if(broken[i]) continue;

        if(!broken[i-1]) a[i]+=a[i-1];

        if(!broken[i-2]&&i-2>=0) a[i]+=a[i-2];

        a[i]%=mod;

    }

    cout<<a[n]<<endl;

    return 0;

}
// Slower C++ solution:
/*|In The Name Of Allah|*/



#include <bits/stdc++.h>



using namespace std;



const int N = 2e5+5;

const int mod = 1e9+7;



int n;

int x;

bool v[N];

int mem[N];



int go(int idx){

    if(v[idx])

        return 0;

    if(idx == n)

        return 1;

    if(idx > n)

        return 0;

    if(~mem[idx])

        return mem[idx];

    return mem[idx] = (go(idx + 1) + go(idx + 2)) % mod;

}



int main(){

    scanf("%d%d" , &n , &x);

    for(int i = 1; i <= x; i++){

        int a;

        scanf("%d" , &a);

        v[a] = 1;

    }

    memset(mem , -1 , sizeof mem);

    printf("%d\n" , go(0));

}


// Faster C++ solution for the same problem (measured speedup: 1.7670606294700073x):
#include <bits/stdc++.h>



using namespace std;

const int N=2e5+5,mod=1e9+7;

#define ll long long

bool broken[N];

int a[N];

int main()

{

    ios_base::sync_with_stdio(0);

    cin.tie(0);cout.tie(0);

    int n,m;

    cin>>n>>m;

    for(int i=0;i<m;i++)

    {

        int x;

        cin>>x;

        broken[x]=1;

    }

    a[0]=1;

    for(int i=1;i<=n;i++)

    {

        if(broken[i]) continue;

        if(!broken[i-1]) a[i]+=a[i-1];

        if(!broken[i-2]&&i-2>=0) a[i]+=a[i-2];

        a[i]%=mod;

    }

    cout<<a[n]<<endl;

    return 0;

}
// Slower C++ solution:
/*|In The Name Of Allah|*/



#include <bits/stdc++.h>



using namespace std;



const int N = 2e5+5;

const int mod = 1e9+7;



int n;

int x;

bool v[N];

int mem[N];



int go(int idx){

    if(v[idx])

        return 0;

    if(idx == n)

        return 1;

    if(idx > n)

        return 0;

    if(~mem[idx])

        return mem[idx];

    return mem[idx] = (go(idx + 1) + go(idx + 2)) % mod;

}



int main(){

    scanf("%d%d" , &n , &x);

    for(int i = 1; i <= x; i++){

        int a;

        scanf("%d" , &a);

        v[a] = 1;

    }

    memset(mem , -1 , sizeof mem);

    printf("%d\n" , go(0));

}


// Faster C++ solution for the same problem (measured speedup: 1.2544321861764192x):
// Fibonacci 

#include <bits/stdc++.h> 

using namespace std; 

long long dp[100100];

long long MOD {1000000007}; 

int main () {

    ios::sync_with_stdio(false);



    int n; cin >> n; 

    int m; cin >> m; 

    vector<int> broken(100010, 0);

    long long x;

    for (int i = 0; i < m; i++) {

        cin >> x; 

        broken[x] = 1; 

    }



    dp[0] = 1;

    for (int num = 0; num < n; num++) {

        for (int next = num+1; next <= min(num+2, n); next++) {

            if (not broken[next]) { 

                dp[next] += dp[num]; 

                dp[next] = dp[next] % 1000000007; 

            }

            else 

                dp[next] = 0;

        }

    }



    // for (int i = 0; i <= n; i++) {

    //     cout << dp[i] << " "; 

    // }

    cout << dp[n]; 

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<string>

#include<iostream>

#include<algorithm>

#include<queue>

#include<math.h>

#include<vector>

#include<map>

using namespace std;

#define ll long long

int mod=1e9+7;

int main()

{

    int n,m;

    while(~scanf("%d%d",&n,&m))

    {

        int a[100005];

        memset(a,0,sizeof(a));

        for(int i=0; i<m; i++)

        {

            int x;

            scanf("%d",&x);

            a[x]=-1;

        }

        a[0]=1;

        for(int i=1; i<=n; i++)

        {

            if(a[i]==-1)

                a[i]=0;

            else

            {

                if(i>=2)

                {

                    a[i]=a[i-1]%mod+a[i-2]%mod;

                }

                else

                {

                    a[i]=a[i-1]%mod;

                }

                a[i]%=mod;

            }

        }

        printf("%d\n",a[n]);

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4013905919636873x):
#include <bits/stdc++.h>

using namespace std;

using ll=long long;

using ld=long double;

using ii=pair<ll,ll>;

using vi=vector<ll>;



#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define INF (ll)1e18

#define all(x) (x).begin(),(x).end()

#define print(a); for(auto x:a)cout<<x<<" "; cout<<"\n";

#define mset(a); memset(a,0,sizeof(a));



const ll MOD=(ll)1e9+7;



int main(){

	ios_base::sync_with_stdio(0);cin.tie(0);

    ll n,m;cin>>n>>m;

    bool state[n+1];mset(state);

    ll d;

    for(int i=0;i<m;i++){

        cin>>d;state[d]=true;

    }

    ll dp[n+1];mset(dp);

    dp[0]=1;

    dp[1]=(state[1]?0:1);

    for(int i=2;i<=n;i++){

        if(state[i]){dp[i]=0;continue;}

        dp[i]=dp[i-2]+dp[i-1];

        dp[i]%=MOD;

    }

    //print(dp);

    cout<<dp[n]<<"\n";

}
// Slower C++ solution:
/*|In The Name Of Allah|*/



#include <bits/stdc++.h>



using namespace std;



const int N = 2e5+5;

const int mod = 1e9+7;



int n;

int x;

bool v[N];

int mem[N];



int go(int idx){

    if(v[idx])

        return 0;

    if(idx == n)

        return 1;

    if(idx > n)

        return 0;

    if(~mem[idx])

        return mem[idx];

    return mem[idx] = (go(idx + 1) + go(idx + 2)) % mod;

}



int main(){

    scanf("%d%d" , &n , &x);

    for(int i = 1; i <= x; i++){

        int a;

        scanf("%d" , &a);

        v[a] = 1;

    }

    memset(mem , -1 , sizeof mem);

    printf("%d\n" , go(0));

}


// Faster C++ solution for the same problem (measured speedup: 1.7658260473990723x):
#include <bits/stdc++.h>

using namespace std;

using ll=long long;

using ld=long double;

using ii=pair<ll,ll>;

using vi=vector<ll>;



#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define INF (ll)1e18

#define all(x) (x).begin(),(x).end()

#define print(a); for(auto x:a)cout<<x<<" "; cout<<"\n";

#define mset(a); memset(a,0,sizeof(a));



const ll MOD=(ll)1e9+7;



int main(){

	ios_base::sync_with_stdio(0);cin.tie(0);

    ll n,m;cin>>n>>m;

    bool state[n+1];mset(state);

    ll d;

    for(int i=0;i<m;i++){

        cin>>d;state[d]=true;

    }

    ll dp[n+1];mset(dp);

    dp[0]=1;

    dp[1]=(state[1]?0:1);

    for(int i=2;i<=n;i++){

        if(state[i]){dp[i]=0;continue;}

        dp[i]=dp[i-2]+dp[i-1];

        dp[i]%=MOD;

    }

    //print(dp);

    cout<<dp[n]<<"\n";

}
// Slower C++ solution:
// Fibonacci 

#include <bits/stdc++.h> 

using namespace std; 

long long dp[100100];

long long MOD {1000000007}; 

int main () {

    ios::sync_with_stdio(false);



    int n; cin >> n; 

    int m; cin >> m; 

    vector<int> broken(100010, 0);

    long long x;

    for (int i = 0; i < m; i++) {

        cin >> x; 

        broken[x] = 1; 

    }



    dp[0] = 1;

    for (int num = 0; num < n; num++) {

        for (int next = num+1; next <= min(num+2, n); next++) {

            if (not broken[next]) { 

                dp[next] += dp[num]; 

                dp[next] = dp[next] % 1000000007; 

            }

            else 

                dp[next] = 0;

        }

    }



    // for (int i = 0; i <= n; i++) {

    //     cout << dp[i] << " "; 

    // }

    cout << dp[n]; 

}

// Faster C++ solution for the same problem (measured speedup: 1.4076695949435187x):
#include <bits/stdc++.h>

using namespace std;

using ll=long long;

using ld=long double;

using ii=pair<ll,ll>;

using vi=vector<ll>;



#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define INF (ll)1e18

#define all(x) (x).begin(),(x).end()

#define print(a); for(auto x:a)cout<<x<<" "; cout<<"\n";

#define mset(a); memset(a,0,sizeof(a));



const ll MOD=(ll)1e9+7;



int main(){

	ios_base::sync_with_stdio(0);cin.tie(0);

    ll n,m;cin>>n>>m;

    bool state[n+1];mset(state);

    ll d;

    for(int i=0;i<m;i++){

        cin>>d;state[d]=true;

    }

    ll dp[n+1];mset(dp);

    dp[0]=1;

    dp[1]=(state[1]?0:1);

    for(int i=2;i<=n;i++){

        if(state[i]){dp[i]=0;continue;}

        dp[i]=dp[i-2]+dp[i-1];

        dp[i]%=MOD;

    }

    //print(dp);

    cout<<dp[n]<<"\n";

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please





int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	int N, M;

	cin >> N >> M;

	int A[100001] = {};

	rep(i, M) {

		int a;

		cin >> a;

		A[a] = 1;

	}



	ll dp[100001] = {};

	dp[0] = 1;

	ll mod = 1e9 + 7;



	rep1(i, N) {

		if (A[i] == 0) {

			dp[i] = dp[i - 1];

			if (i - 2 >= 0) dp[i] += dp[i - 2];

			dp[i] %= mod;

		}

	}



	co(dp[N]);



	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.1523177795137483x):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int cm = 1 << 17;

char cn[cm], * ci = cn + cm, ct;

inline char getcha() {

	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }

	return *ci++;

}

inline int getint() {

	int A = 0;

	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';

	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';

	return A;

}



int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	int N = getint(), M = getint();

	if (M > N / 2) co(0);

	else {

		int A[100001];

		rep(i, M) {

			int a = getint();

			A[a] = 1;

		}



		ll dp[100002];

		dp[0] = 0;

		dp[1] = 1;

		ll mod = 1e9 + 7;

		int meyasu = 0;

		rep1(i, N) {

			if (A[i] != 1) {

				dp[i + 1] = dp[i] + dp[i - 1];

				meyasu++;

				if (meyasu >= 30) {

					dp[i] %= mod;

					dp[i + 1] %= mod;

					meyasu = 0;

				}

			}

			else dp[i + 1] = 0;

		}

		co(dp[N + 1] % mod);

	}



	Would you please return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define inf 1000000007



int main() {

	ll n,m,a[100010],dp[100010];

	cin>>n>>m;

	for(int i=0;i<100010;i++){

		a[i]=0;

	}

	for(int i=0;i<m;i++){

		int z;

		cin>>z;

		a[z]=1;

	}

	dp[0]=1;

	if(a[1]!=1){

		dp[1]=1;

	}

	for(int i=2;i<=n;i++){

		dp[i]=dp[i-1]+dp[i-2];

		dp[i]%=inf;

		if(a[i]==1){

			dp[i]=0;

		}

	}

	cout << dp[n];

}

// Faster C++ solution for the same problem (measured speedup: 1.8338022188116156x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define INF 1LL<<62

#define inf 1000000007 



ll a[100010];

bool b[100010];

int main() {

	ll n,k;

	cin>>n>>k;

	for(int i=0;i<k;i++){

		ll z;

		cin>>z;z--;

		b[z]=1;

	}

	if(b[0]!=1){

		a[0]=1;

	}

	if(b[1]!=1){

		a[1]=1+a[0];

	}

	for(int i=2;i<=n;i++){

		a[i]=a[i-1]+a[i-2];

		a[i]%=inf;

		if(b[i]==1){

			a[i]=0;

		}

	}

	n--;

	cout << a[n];

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a[100001] = {0}, b[100001] = {0};



int main () {

    int n, m, temp;

    cin >> n >> m;

    for (int i = 1; i <= m; i++) {cin >> temp; b[temp]++;}

    a[1] = b[1] == 0 ? 1 : 0;

    a[2] = b[2] == 0 ? (b[1] == 0 ? 2 : 1) : 0;

    for (int i = 3; i <= n; i++) if (!b[i]) a[i] = (a[i-1] + a[i-2]) % 1000000007;

    cout << a[n] << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.029853664733754x):
#include <cstdio>



int main ()

{

	int n, m, a[100005], in, temp;

	temp = scanf("%d %d", &n, &m);

	for (int i = 1; i <= n; i++)

		a[i] = -1;

	for (int i = 1; i <= m; i++)

	{

		temp = scanf("%d", &in);

		a[in] = 0;

	}

	if (a[1] != 0)

		a[1] = 1;

	if (a[2] != 0)

		a[2] = 1 + a[1];

	for (int i = 3; i <= n; i++)

		if (a[i] == -1)

			a[i] = (a[i - 2] + a[i - 1]) % 1000000007;

	temp = printf("%d", a[n]);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstring>

using namespace std;



int a[100001] = {0};

int N = 1000000007;



int main () {

	int n, m, temp;

	memset(a, -1, sizeof(a));

	cin >> n >> m;

	for (int i = 1; i <= m; i++) {cin >> temp; a[temp] = 0;}

	if (a[1] != 0) a[1] = 1;

	if (a[2] != 0 && a[1] == 0) a[2] = 1;

	if (a[2] != 0 && a[1] != 0) a[2] = 2;

	for (int i = 3; i <= n; i++) {

		a[i] = (a[i] == 0) ? 0 : (a[i-1] % N + a[i-2] % N) % N;

	}

	cout << a[n] << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 7.064853714337995x):
#include <cstdio>



int main ()

{

	int n, m, a[100005], in, temp;

	temp = scanf("%d %d", &n, &m);

	for (int i = 1; i <= n; i++)

		a[i] = -1;

	for (int i = 1; i <= m; i++)

	{

		temp = scanf("%d", &in);

		a[in] = 0;

	}

	if (a[1] != 0)

		a[1] = 1;

	if (a[2] != 0)

		a[2] = 1 + a[1];

	for (int i = 3; i <= n; i++)

		if (a[i] == -1)

			a[i] = (a[i - 2] + a[i - 1]) % 1000000007;

	temp = printf("%d", a[n]);

	return 0;

}