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

#define _GLIBCXX_DEBUG

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

using namespace std;

using ll = long long;

const int INF = 1001001001;

const int MOD = 1000000007;

typedef long long ll;



int N, M;

vector<ll> dp(100010,INF);





int main(){

    cin >> N >> M;

    dp[0] = 1, dp[1] = 1;

    rep(i, M){

        int a;

        cin >> a;

        dp[a] = 0; // 壊れている段

    }

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

        if(dp[i] == INF)

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

        else{

            dp[i] = 0;

        }

    }

    cout << dp[N] << endl;

    return 0;





}


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

using namespace std;

using ll = long long;

using P = pair<int, int>;

const int INF = 1001001001;

const ll LINF = 1LL << 60;

const int MOD = 1'000'000'007;



template <typename T>

void print(const T &v)

{

    for (int i = 0; i < v.size(); i++)

    {

        if (i)

            cout << ' ';

        cout << v[i];

    }

    cout << endl;

}



template <class T>

inline bool chmin(T &a, T b)

{

    if (a > b)

    {

        a = b;

        return true;

    }

    return false;

}



template <class T>

inline bool chmax(T &a, T b)

{

    if (a < b)

    {

        a = b;

        return true;

    }

    return false;

}



const int MAX = 100010;



int n, m;

ll dp[MAX];

bool broken[MAX];



int main()

{

    cin >> n >> m;

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

    {

        int a;

        cin >> a;

        broken[a] = true;

    }

    dp[0] = 1;

    if (!broken[1])

    {

        dp[1] = 1;

    }

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

    {

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

        if (broken[i])

        {

            dp[i] = 0;

        }

    }

    cout << dp[n] << endl;

    return 0;

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

#define f first

#define s second

#define mp make_pair

#define pb push_back



using namespace std;



typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef vector<ll> vll;



int n;

vll dp(1000005, -1);

vector<bool> broken(1000005, false);



ll f(int p) {

    if (broken[p]) {

        return 0;

    }

    if (p == n || p == n-1) {

        return 1;

    }

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

        return dp[p];

    }

    ll ans = (f(p+1) + f(p+2)) % ((ll)(1e9 + 7));

    dp[p] = ans;

    return ans;

}



int main(){

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

	

    int m, val;

    cin >> n >> m;

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

        cin >> val;

        broken[val] = true;

    }

	

    cout << f(0) << endl;

	

	return 0;

}


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

#define ll long long

using namespace std;



int main()

{

	/*#ifndef ONLINE_JUDGE

		freopen("in.txt","r",stdin);

		freopen("out.txt","w",stdout);

	#endif*/

	ios_base::sync_with_stdio(false);

   	cin.tie(NULL);

   	ll N,M; cin >> N >> M;

   	vector<bool> broken(N+1, true);



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

   	{

   		ll a; cin >> a;

   		broken[a] = false;

   	}



	ll pasos = 1;

   	ll p = 0;



   	for (ll i = 1; i < N+1; ++i)

   	{

   		if (!broken[i] and !broken[i-1])

   		{

   			pasos = 0;

   			break;

   		}

   		if (broken[i] and broken[i-1] and (i > 1 and broken[i-2]))

   		{

   			ll aux = pasos;

   			pasos = (pasos + p) % 1000000007;

   			p = aux;

   		}

   		else if (i==1 and broken[i])

   		{

   			ll aux = pasos;

   			pasos = (pasos + p) % 1000000007;

   			p = aux;

   		}

   		else

   		{

   			p = pasos;

   		}

   	}



   	cout << pasos%1000000007 << '\n';







	return 0;	

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

#define f first

#define s second

#define mp make_pair

#define pb push_back



using namespace std;



typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef vector<ll> vll;



int n;

vll dp(1000005, -1);

vector<bool> broken(1000005, false);



ll f(int p) {

    if (broken[p]) {

        return 0;

    }

    if (p == n || p == n-1) {

        return 1;

    }

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

        return dp[p];

    }

    ll ans = (f(p+1) + f(p+2)) % ((ll)(1e9 + 7));

    dp[p] = ans;

    return ans;

}



int main(){

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

	

    int m, val;

    cin >> n >> m;

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

        cin >> val;

        broken[val] = true;

    }

	

    cout << f(0) << endl;

	

	return 0;

}


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

using namespace std;

int n,m,ans,z;

int a[100005],f[100005];

int main(){

	cin>>n>>m;

	f[1]=1;

	f[2]=2;

	f[0]=1;

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

		cin>>a[i];

		f[a[i]]=-1;

	}

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

 		if(f[i-1]==-1&&f[i-2]==-1){

 			cout<<"0";

			return 0;

		 }

 		if(f[i]==-1){

 			continue;

		}

 		if(f[i-1]==-1){

 			f[i]=f[i-2]%1000000007;

		 }

		 else if(f[i-2]==-1){

		 	f[i]=f[i-1]%1000000007;

		 }

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

	}

	cout<<f[n]%1000000007;

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

#define f first

#define s second

#define mp make_pair

#define pb push_back



using namespace std;



typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef vector<ll> vll;



int n;

vll dp(1000005, -1);

vector<bool> broken(1000005, false);



ll f(int p) {

    if (broken[p]) {

        return 0;

    }

    if (p == n || p == n-1) {

        return 1;

    }

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

        return dp[p];

    }

    ll ans = (f(p+1) + f(p+2)) % ((ll)(1e9 + 7));

    dp[p] = ans;

    return ans;

}



int main(){

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

	

    int m, val;

    cin >> n >> m;

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

        cin >> val;

        broken[val] = true;

    }

	

    cout << f(0) << endl;

	

	return 0;

}


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

using namespace std;

int main(){

  long long int n,m,x;

  cin>>n>>m;

  vector<bool>a(100009,false);

  long long int b[n+1];

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

    cin>>x;

    a[x]=true;

  }

    b[1] = 1;

    b[2] = 2;

    if(a[1]==true){

        b[1] = 0;

        b[2] = 1;

    }

    if(a[2] == true){

        b[2] = 0;

    }

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

        //cout<<a[i]<<endl;

    if(a[i]==true){

             b[i]=0;

    }

    else{

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

   b[i]=b[i]%1000000007;

        //cout<<i<<" "<<b[i]<<endl;

    }

   }

   cout<<b[n]%1000000007<<endl;

}
// Slower C++ solution:
#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 (index <= 1)

        return broken[index] ? 0 : 1;

    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.resize(steps_amount+1);

    ways.assign(steps_amount+1, -1);

    

    broken.resize(steps_amount+1);

    broken.assign(steps_amount+1, false);



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

    {

        int j;

        cin >> j;

        broken[j] = true;

    }



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



    return 0;

}

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

#include<string.h>

int vis[100005];

int n,m;

int mod=1e9+7;

int check()

{

    int i=0,j;

    for(j=1;j<=n;++j)

    {

            if(vis[j]==-1)

            {

                vis[j]=0;

            }

            else

            {

                vis[j]=(j>=2?vis[j-2]:0)%mod+vis[j-1]%mod;

            }

    }

    return vis[j-1]%=mod;

}

int main()

{

    int flag=0;

    memset(vis,0,sizeof(vis));

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

    vis[0]=1;

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

    {

        int x;

        scanf("%d",&x);

        vis[x]=-1;

        if(vis[x-1]==-1)

        {

            flag=1;

        }

    }

    if(flag==1)

    {

        printf("0\n");

    }

    else

    {

        printf("%d",check());

    }

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

#define f first

#define s second

#define mp make_pair

#define pb push_back



using namespace std;



typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef vector<ll> vll;



int n;

vll dp(1000005, -1);

vector<bool> broken(1000005, false);



ll f(int p) {

    if (broken[p]) {

        return 0;

    }

    if (p == n || p == n-1) {

        return 1;

    }

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

        return dp[p];

    }

    ll ans = (f(p+1) + f(p+2)) % ((ll)(1e9 + 7));

    dp[p] = ans;

    return ans;

}



int main(){

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

	

    int m, val;

    cin >> n >> m;

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

        cin >> val;

        broken[val] = true;

    }

	

    cout << f(0) << endl;

	

	return 0;

}


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

#include<string.h>

int vis[100005];

int n,m;

int mod=1e9+7;

int check()

{

    int i=0,j;

    for(j=1;j<=n;++j)

    {

            if(vis[j]==-1)

            {

                vis[j]=0;

            }

            else

            {

                vis[j]=(j>=2?vis[j-2]:0)%mod+vis[j-1]%mod;

            }

    }

    return vis[j-1]%=mod;

}

int main()

{

    int flag=0;

    memset(vis,0,sizeof(vis));

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

    vis[0]=1;

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

    {

        int x;

        scanf("%d",&x);

        vis[x]=-1;

        if(vis[x-1]==-1)

        {

            flag=1;

        }

    }

    if(flag==1)

    {

        printf("0\n");

    }

    else

    {

        printf("%d",check());

    }

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

#define ll long long

using namespace std;



int main()

{

	/*#ifndef ONLINE_JUDGE

		freopen("in.txt","r",stdin);

		freopen("out.txt","w",stdout);

	#endif*/

	ios_base::sync_with_stdio(false);

   	cin.tie(NULL);

   	ll N,M; cin >> N >> M;

   	vector<bool> broken(N+1, true);



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

   	{

   		ll a; cin >> a;

   		broken[a] = false;

   	}



	ll pasos = 1;

   	ll p = 0;



   	for (ll i = 1; i < N+1; ++i)

   	{

   		if (!broken[i] and !broken[i-1])

   		{

   			pasos = 0;

   			break;

   		}

   		if (broken[i] and broken[i-1] and (i > 1 and broken[i-2]))

   		{

   			ll aux = pasos;

   			pasos = (pasos + p) % 1000000007;

   			p = aux;

   		}

   		else if (i==1 and broken[i])

   		{

   			ll aux = pasos;

   			pasos = (pasos + p) % 1000000007;

   			p = aux;

   		}

   		else

   		{

   			p = pasos;

   		}

   	}



   	cout << pasos%1000000007 << '\n';







	return 0;	

}


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

#include<string.h>

int vis[100005];

int n,m;

int mod=1e9+7;

int check()

{

    int i=0,j;

    for(j=1;j<=n;++j)

    {

            if(vis[j]==-1)

            {

                vis[j]=0;

            }

            else

            {

                vis[j]=(j>=2?vis[j-2]:0)%mod+vis[j-1]%mod;

            }

    }

    return vis[j-1]%=mod;

}

int main()

{

    int flag=0;

    memset(vis,0,sizeof(vis));

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

    vis[0]=1;

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

    {

        int x;

        scanf("%d",&x);

        vis[x]=-1;

        if(vis[x-1]==-1)

        {

            flag=1;

        }

    }

    if(flag==1)

    {

        printf("0\n");

    }

    else

    {

        printf("%d",check());

    }

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

using namespace std;

int n,m,ans,z;

int a[100005],f[100005];

int main(){

	cin>>n>>m;

	f[1]=1;

	f[2]=2;

	f[0]=1;

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

		cin>>a[i];

		f[a[i]]=-1;

	}

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

 		if(f[i-1]==-1&&f[i-2]==-1){

 			cout<<"0";

			return 0;

		 }

 		if(f[i]==-1){

 			continue;

		}

 		if(f[i-1]==-1){

 			f[i]=f[i-2]%1000000007;

		 }

		 else if(f[i-2]==-1){

		 	f[i]=f[i-1]%1000000007;

		 }

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

	}

	cout<<f[n]%1000000007;

}

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

#include<string.h>

int vis[100005];

int n,m;

int mod=1e9+7;

int check()

{

    int i=0,j;

    for(j=1;j<=n;++j)

    {

            if(vis[j]==-1)

            {

                vis[j]=0;

            }

            else

            {

                vis[j]=(j>=2?vis[j-2]:0)%mod+vis[j-1]%mod;

            }

    }

    return vis[j-1]%=mod;

}

int main()

{

    int flag=0;

    memset(vis,0,sizeof(vis));

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

    vis[0]=1;

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

    {

        int x;

        scanf("%d",&x);

        vis[x]=-1;

        if(vis[x-1]==-1)

        {

            flag=1;

        }

    }

    if(flag==1)

    {

        printf("0\n");

    }

    else

    {

        printf("%d",check());

    }

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

using namespace std;

int main(){

  long long int n,m,x;

  cin>>n>>m;

  vector<bool>a(100009,false);

  long long int b[n+1];

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

    cin>>x;

    a[x]=true;

  }

    b[1] = 1;

    b[2] = 2;

    if(a[1]==true){

        b[1] = 0;

        b[2] = 1;

    }

    if(a[2] == true){

        b[2] = 0;

    }

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

        //cout<<a[i]<<endl;

    if(a[i]==true){

             b[i]=0;

    }

    else{

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

   b[i]=b[i]%1000000007;

        //cout<<i<<" "<<b[i]<<endl;

    }

   }

   cout<<b[n]%1000000007<<endl;

}


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

#include<string.h>

int vis[100005];

int n,m;

int mod=1e9+7;

int check()

{

    int i=0,j;

    for(j=1;j<=n;++j)

    {

            if(vis[j]==-1)

            {

                vis[j]=0;

            }

            else

            {

                vis[j]=(j>=2?vis[j-2]:0)%mod+vis[j-1]%mod;

            }

    }

    return vis[j-1]%=mod;

}

int main()

{

    int flag=0;

    memset(vis,0,sizeof(vis));

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

    vis[0]=1;

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

    {

        int x;

        scanf("%d",&x);

        vis[x]=-1;

        if(vis[x-1]==-1)

        {

            flag=1;

        }

    }

    if(flag==1)

    {

        printf("0\n");

    }

    else

    {

        printf("%d",check());

    }

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

#define f first

#define s second

#define mp make_pair

#define pb push_back



using namespace std;



typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef vector<ll> vll;



int n;

vll dp(1000005, -1);

vector<bool> broken(1000005, false);



ll f(int p) {

    if (broken[p]) {

        return 0;

    }

    if (p == n || p == n-1) {

        return 1;

    }

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

        return dp[p];

    }

    ll ans = (f(p+1) + f(p+2)) % ((ll)(1e9 + 7));

    dp[p] = ans;

    return ans;

}



int main(){

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

	

    int m, val;

    cin >> n >> m;

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

        cin >> val;

        broken[val] = true;

    }

	

    cout << f(0) << endl;

	

	return 0;

}


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

using namespace std;

int n ,m;

map<int,bool>broken;

long long mem[100005];

long long mod =1e9+7;

int main() {

	cin>>n>>m;

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

		int x ;cin>>x;

		broken[x] = true;

	}

	mem[0] = 1;if(!broken[1])mem[1] = 1;

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

		if(broken[i])

			continue;

		mem[i]+=(mem[i-1] + mem[i-2])%mod;

	}

	cout<<mem[n];

    return 0;

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

#define f first

#define s second

#define mp make_pair

#define pb push_back



using namespace std;



typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef vector<ll> vll;



int n;

vll dp(1000005, -1);

vector<bool> broken(1000005, false);



ll f(int p) {

    if (broken[p]) {

        return 0;

    }

    if (p == n || p == n-1) {

        return 1;

    }

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

        return dp[p];

    }

    ll ans = (f(p+1) + f(p+2)) % ((ll)(1e9 + 7));

    dp[p] = ans;

    return ans;

}



int main(){

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

	

    int m, val;

    cin >> n >> m;

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

        cin >> val;

        broken[val] = true;

    }

	

    cout << f(0) << endl;

	

	return 0;

}


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

using namespace std;

const int N = 1e5 + 25, M = 1e6 + 25, oo = 1e9+7, mxmsk = 1 << 16;

const long long OO = 1e18+25;

#define par pair<pair<int,int>, int>

#define f first

#define s second

    

int n,m,s[N], mem[N],x;



int dp(int idx=0)

{

    if(s[idx] || idx > n) return 0;

    if(idx == n) return 1;

    int &ret = mem[idx];

    if(~ret) return ret;

    return ret = (dp(idx+1) + dp(idx+2)) % oo;

}



int main()

{

    memset(mem, -1, sizeof mem);

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

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

    {

        scanf("%d",&x);

        s[x] = 1;

    }printf("%d",dp());

    return 0;

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

using namespace std;



// 入力

int N, M;

bool a[100010];



// DP テーブル

long long dp[100010];



int main() {

    cin.tie(0);

    ios::sync_with_stdio(false);



    cin >> N >> M;

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

    	int x; cin >> x;

    	a[x] = true;

    }



    // 初期化 (最小化問題なので INF に初期化)

    memset(dp, 0, sizeof(dp));



    // 初期条件

    dp[0] = 1;

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

    else dp[1] = 1;



    // ループ

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

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

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

    }



    // 答え

    cout << dp[N] << endl;

    return 0;

}

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

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

using namespace std;

typedef long long int ll;

typedef pair<int, int> P;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



const int mod = 1000000007;

struct mint{

	ll x;

	mint(ll x = 0):x((x%mod+mod)%mod){}

	mint operator-() const{return mint(-x);}

	mint& operator+=(const mint a){

		if((x += a.x) >= mod) x -= mod;

		return *this;

	}

	mint& operator-=(const mint a){

		if((x += mod-a.x) >= mod) x -= mod;

		return *this;

	}

	mint& operator*=(const mint a){

		(x *= a.x) %= mod;

		return *this;

	}

	mint operator+(const mint a) const{

		mint res(*this);

		return res+=a;

	}

	mint operator-(const mint a) const{

		mint res(*this);

		return res-=a;

	}

	mint operator*(const mint a) const{

		mint res(*this);

		return res*=a;

	}

	mint pow(ll t) const{

		if(!t) return 1;

		mint a = pow(t>>1);

		a *= a;

		if(t&1) a *= *this;

		return a;

	}

	mint inv() const{

		return pow(mod-2);

	}

	mint& operator/=(const mint a){

		return (*this) *= a.inv();

	}

	mint operator/(const mint a) const{

		mint res(*this);

		return res/=a;

	}

	bool operator==(const mint a){

		return x == a.x;

	}

    bool operator!=(const mint a){

		return x != a.x;

	}

};



int main(){

	cin.tie(0);

	ios::sync_with_stdio(false);

    int n, m;

    cin >> n >> m;

    vector<mint> dp(n+5, 0);

    rep(i,m){

        int a;

        cin >> a;

        dp[a] = -1;

    }

    dp[0] = 1;

    rep(i,n+1){

        if(dp[i] == -1) continue;

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

        if(dp[i+2] != -1) dp[i+2] += dp[i];

    }

    cout << dp[n].x << endl;

	return 0;

}
// Slower C++ solution:
// abca29c.cpp : Typical Stairs

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define MOD 1000000007

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



vector<ll> v(100000+1,-1);



ll calc(int i, int n){

	if(i>n) return 0;

	if(i==n) return 1;

	if(v[i]==-2) return 0;

	if(v[i]==-1){

		v[i] = (calc(i+1,n) + calc(i+2,n)) % MOD;

	}

	return v[i];

}



int main(){

	int n,m; cin>>n>>m;

	rp(i,m){

		int a; cin>>a;

		v[a] = -2;

	}

	ll ans = calc(0,n);

	cout<< ans <<endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.7956811434312554x):
// abca29c.cpp : Typical Stairs

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define MOD 1000000007

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



int main(){

	int n,m; cin>>n>>m;



	vector<bool> ok(n+1,true);

	rp(i,m){

		int a; cin>>a;

		ok[a] = false;

	}



	vector<ll> dp(n+1);

	dp[0] = 1;

	rp(now,n)

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

			if(ok[next]) dp[next] = (dp[next] + dp[now]) % MOD;



	cout<< dp[n] <<endl;

}
// Slower C++ solution:
// abca29c.cpp : Typical Stairs

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define MOD 1000000007

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



vector<ll> v(100000+1,-1);



ll calc(int i, int n){

	if(i>n) return 0;

	if(i==n) return 1;

	if(v[i]==-2) return 0;

	if(v[i]==-1){

		v[i] = (calc(i+1,n) + calc(i+2,n)) % MOD;

	}

	return v[i];

}



int main(){

	int n,m; cin>>n>>m;

	rp(i,m){

		int a; cin>>a;

		v[a] = -2;

	}

	ll ans = calc(0,n);

	cout<< ans <<endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.2891690072614446x):
// abca29c.cpp : Typical Stairs

#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007



vector<int> v(100000+1,-1);



int calc(int i, int n){

	if(i>n) return 0;

	if(i==n) return 1;

	if(v[i]==-2) return 0;

	if(v[i]==-1) v[i] = (calc(i+1,n) + calc(i+2,n)) % MOD;

	return v[i];

}



int main(){

	int n,m; cin>>n>>m;



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

		int a; cin>>a;

		v[a] = -2;

	}



	int ans = calc(0,n);



	cout<< ans <<endl;

}
// Slower C++ solution:
// abca29c.cpp : Typical Stairs

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define MOD 1000000007

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



vector<ll> v(100000+1,-1);



ll calc(int i, int n){

	if(i>n) return 0;

	if(i==n) return 1;

	if(v[i]==-2) return 0;

	if(v[i]==-1){

		v[i] = (calc(i+1,n) + calc(i+2,n)) % MOD;

	}

	return v[i];

}



int main(){

	int n,m; cin>>n>>m;

	rp(i,m){

		int a; cin>>a;

		v[a] = -2;

	}

	ll ans = calc(0,n);

	cout<< ans <<endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.7943434741435988x):
// abca29c.cpp : Typical Stairs

#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007



int calc(vector<int> &v, int i, int n){

	if(i>n) return 0;

	if(i==n) return 1;

	if(v[i]==-2) return 0;

	if(v[i]==-1) v[i] = (calc(v,i+1,n) + calc(v,i+2,n)) % MOD;

	return v[i];

}



int main(){

	int n,m; cin>>n>>m;



	vector<int> v(n+1,-1);

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

		int a; cin>>a;

		v[a] = -2;

	}



	int ans = calc(v,0,n);



	cout<< ans <<endl;

}