stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

long long mod=1e9+7;

int vis[100005];



int main()

{

    int n,m;

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

    {



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

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

       {

           int x;

           scanf("%d",&x);

           vis[x]=-1;

       }

        vis[0]=1;

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

        {

             if(vis[i]==-1)

            vis[i]=0;

        else

            if(i>=2)

        {

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

        }

        else

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

        vis[i]%=mod;

        }



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

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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];

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

long long mod=1e9+7;

int vis[100005];



int main()

{

    int n,m;

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

    {



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

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

       {

           int x;

           scanf("%d",&x);

           vis[x]=-1;

       }

        vis[0]=1;

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

        {

             if(vis[i]==-1)

            vis[i]=0;

        else

            if(i>=2)

        {

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

        }

        else

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

        vis[i]%=mod;

        }



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

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
/*|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));

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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]; 

}

// Optimized solution to the same problem (faster):
#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";

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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];

}

// Optimized solution to the same problem (faster):
#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];

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;





}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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());

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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());

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;	

}


// Optimized solution to the same problem (faster):
#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());

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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());

    }

}


// Fastest known solution for this problem: