stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
// 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;

}

// Faster C++ solution for the same problem (measured speedup: 1.3918605427501598x):
// 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;

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

using namespace std;

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;

}

typedef long long int ll;



#define EPS (1e-7)

#define INF (1e9)

#define PI (acos(-1))

#define MOD (1000000007)

#define ALL(v) (v).begin(), (v).end()

int dx[4] = {1, 0, -1, 0};

int dy[4] = {0, 1, 0, -1};



//-------------------------------------



vector<ll> dp(100010, 0);



int main()

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    ll n, m;

    cin >> n >> m;

    set<ll> a;

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

    {

        int t;

        cin >> t;

        a.insert(t);

    }

    dp[0] = 1;

    dp[1] = 1;

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

    {

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

        if (a.count(i - 1))

        {

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

        }

        if (a.count(i - 2))

        {

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

        }

    }

    cout << dp[n] % MOD << endl;

}

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

using namespace std;

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;

}

typedef long long int ll;

    

#define EPS (1e-7)

#define INF (1<<30)

#define LLINF (1LL<<60)

#define PI (acos(-1))

#define MOD (1000000007)

#define ALL(v) (v).begin(), (v).end()

#define RALL(v) (v).rbegin(), (v).rend()

const int dx[4] = {1, 0, -1, 0};

const int dy[4] = {0, 1, 0, -1};



//-------------------------------------



ll dp[100010];



int main()

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    ll n,m;

    cin>>n>>m;

    set<ll> se;

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

        ll a;

        cin>>a;

        se.insert(a);

    }

    dp[0]=1;

    dp[1]=1;

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

        if(!se.count(i-1)){

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

        }

        if(!se.count(i-2)){

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

        }

    }

    cout<<dp[n]<<endl;

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



using namespace std;



#define li long long int



const int N = 1e5 + 3;

const li mod = 1e9 + 7;



int n, m;

int broken[N];

li dp[N];



li go(int pos) {

	if (broken[pos]) return 0;

	if (pos >= n) return pos == n;

	if (dp[pos] != -1) return dp[pos];

	li ans = go(pos + 1) + go(pos + 2);

	ans %= mod;

	return dp[pos] = ans;

}



void solve() {

	cin >> n >> m;

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

		int x;

		cin >> x;

		broken[x] = 1;

	}

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

	li ans = go(0);

	cout << ans;

}



int main() {

	int t = 1;

	// cin >> t;

	while (t--) {

		solve();

	}

	return 0;

}

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

using namespace std;



const long long MOD = 1e9 + 7;



int N, M;

// DPテーブル、0-N段までのDP値を管理する

// 数え上げのため、初期値は0

long long dp[100100] = {0LL};

// 何段目が壊れているかを管理する配列

bool is_broken[100100] = {false};



int main() {

  scanf("%d%d", &N, &M);

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

    int a = 0;

    scanf("%d", &a);

    is_broken[a] = true;

  }

  // 足場0は初期値1, 初期値1とみなすことで、

  // フィボナッチ数列のN番目の項を求める問題と同じように解くことができる

  // {1, 1, 2, 3, 5, ... , N}

  // ただし、dp値を更新する際に、足場が壊れているかを確認する

  dp[0] = 1LL; 

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

    if (is_broken[i]) continue;

    if (!is_broken[i + 1]) dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;

    if (!is_broken[i + 2]) dp[i + 2] = (dp[i + 2] + dp[i]) % MOD;

  }



  cout <<dp[N] << endl;

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

using namespace std;

const int MOD = 1e9 + 7;

const int MAX_N = 100100;



int N, M;

vector<bool> Broken;

long long dp[MAX_N];



void input(){

    cin >> N >> M;

    Broken.assign(N, false);

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

        int a; cin >> a;

        Broken[a] = true;

    }

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

        dp[i] = -1;

    }

    dp[0] = 1;

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

}



int DP(int n){

    if (Broken[n]) return dp[n] = 0;

    if (dp[n] != -1) return dp[n];

    return dp[n] = ((DP(n - 1) + DP(n - 2)) % MOD);

}



int main(){

    input();

    DP(N);

    cout << dp[N] << endl;

    return 0;

}

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

using namespace std;

const int MOD = 1e9+7;



template<int mod> struct ModInt {

    int x;

    ModInt() : x(0) {}

    ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) { if((x += p.x) >= mod) x -= mod; return *this; }

    ModInt &operator-=(const ModInt &p) { if((x += mod-p.x) >= mod) x -= mod; return *this; }

    ModInt &operator*=(const ModInt &p) { x = (int)(1LL*x*p.x%mod); return *this; }

    ModInt &operator/=(const ModInt &p) { *this *= p.inverse(); return *this; }

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

    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }

    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {

        int a = x, b = mod, u = 1, v = 0, t;

        while(b > 0) { t = a/b; a -= t*b; swap(a, b); u -= t*v; swap(u, v); }

        return ModInt(u);

    }

    ModInt pow(int e){

        long long a = 1, p = x;

        while(e > 0) {

            if (e%2 == 0) { p = (p*p)%mod; e /= 2; }

            else { a = (a*p)%mod; e--; }

        }

        return ModInt(a);

    }

    friend ostream &operator<<(ostream &os, const ModInt<mod> &p) {

        return os << p.x;

    }

    friend istream &operator>>(istream &is, ModInt<mod> &a) {

        long long x;

        is >> x;

        a = ModInt<mod>(x);

        return (is);

    }

};



using modint = ModInt<MOD>;



int main() {

    int n, m;

    cin >> n >> m;

    vector<modint> dp(n+1, 0);

    vector<bool> step(n+1, 1);

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

        int a;

        cin >> a;

        step[a] = 0;

    }

    

    dp[0] = 1;

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

    

    for (int i = 2; i <= n; i++) if (step[i]) {

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

    }

    

    cout << dp[n] << endl;

    return 0;

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

#include <vector>

using namespace std;

const int MAX_N = 100100;

const long long MOD = 1000000007;



int main() {

    int n, m;

    cin >> n >> m;

    vector<long long> dp(MAX_N, 0);

    vector<bool> step(MAX_N, true);



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

        int a;

        cin >> a;

        step.at(a) = false;

    }



    dp.at(0) = 1;

    if (step.at(1) == true) {

        dp.at(1) = 1;

    }



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

        if (step.at(i) == false) continue;

        dp.at(i) = dp.at(i-1) + dp.at(i-2);

        dp.at(i) %= MOD;

    }



    cout << dp.at(n) << endl;

    return 0;

}

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

using namespace std;

const int MOD = 1e9+7;



template<int mod> struct ModInt {

    int x;

    ModInt() : x(0) {}

    ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) { if((x += p.x) >= mod) x -= mod; return *this; }

    ModInt &operator-=(const ModInt &p) { if((x += mod-p.x) >= mod) x -= mod; return *this; }

    ModInt &operator*=(const ModInt &p) { x = (int)(1LL*x*p.x%mod); return *this; }

    ModInt &operator/=(const ModInt &p) { *this *= p.inverse(); return *this; }

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

    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }

    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {

        int a = x, b = mod, u = 1, v = 0, t;

        while(b > 0) { t = a/b; a -= t*b; swap(a, b); u -= t*v; swap(u, v); }

        return ModInt(u);

    }

    ModInt pow(int e){

        long long a = 1, p = x;

        while(e > 0) {

            if (e%2 == 0) { p = (p*p)%mod; e /= 2; }

            else { a = (a*p)%mod; e--; }

        }

        return ModInt(a);

    }

    friend ostream &operator<<(ostream &os, const ModInt<mod> &p) {

        return os << p.x;

    }

    friend istream &operator>>(istream &is, ModInt<mod> &a) {

        long long x;

        is >> x;

        a = ModInt<mod>(x);

        return (is);

    }

};



using modint = ModInt<MOD>;



int main() {

    int n, m;

    cin >> n >> m;

    vector<modint> dp(n+1, 0);

    vector<bool> step(n+1, 1);

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

        int a;

        cin >> a;

        step[a] = 0;

    }

    

    dp[0] = 1;

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

    

    for (int i = 2; i <= n; i++) if (step[i]) {

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

    }

    

    cout << dp[n] << endl;

    return 0;

}
// Slower C++ solution:


#include <algorithm>

#include <iostream>

#include <vector>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> P;



#define MOD 1000000007

#define REP(i, N) for (int i = 0; i < N; ++i)

#define REP1(i, N) for (int i = 1; i <= N; ++i)

#define RREP(i, N) for (int i = N - 1; i >= 0; --i)

#define ALL(a) a.begin(), a.end()



int main() {

  int n, m;

  cin >> n >> m;

  bool ok[n + 1];

  REP(i, n + 1) ok[i] = true;

  REP(i, m) {

    int a;

    cin >> a;

    ok[a] = false;

  }

  ll dp[101010] = {};

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

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

    if (ok[i - 1]) {

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

      dp[i] %= MOD;

    }

    if (ok[i - 2]) {

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

      dp[i] %= MOD;

    }

  }

  cout << dp[n] << endl;

  return 0;

}

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

#include <cmath>

#include <cstdio>

#include <deque>

#include <iostream>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <vector>



using namespace std;



typedef long long ll;



#define MOD 1000000007



int main() {

  int n, m;

  cin >> n >> m;

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

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

    int a;

    cin >> a;

    ok[a] = false;

  }

  vector<ll> dp(n + 2, 0);

  dp[0] = 1;

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

    if (ok[i]) {

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

      dp[i + 1] %= MOD;

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

      dp[i + 2] %= MOD;

    }

  }

  cout << dp[n] << endl;

  return 0;

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

using namespace std;

const int inf=0x3f3f3f3f;

const long long mod=1e9+7;

long long n,m;

long long dp[100000+10];

long long sum;

int main()

{

    cin>>n>>m;

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

    {

        int a;

        cin>>a;

        dp[a]=-inf;

    }

    dp[0]=-inf;

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

    {

        if(dp[i]==-inf)

        {

            if(dp[i+1]==-inf)

            {

                if(i!=0)

                {

                    cout<<"0";

                    return 0;

                }

                else

                {

                    if(dp[2]==-inf)

                    {

                        cout<<"0";

                        return 0;

                    }

                    else

                    {

                        dp[2]=1;

                        dp[1]=0;

                        continue;

                    }

                }

            }

            else

            {

                if(i!=0)

                {

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

                    dp[i]=0;

                    continue;

                }

                else

                {

                    dp[1]=1;

                    dp[0]=1;

                    continue;

                }

            }

        }

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

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

        dp[i]%=mod;

    }

    sum=dp[n];

    cout<<sum%mod;

    return 0;

}

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

#define ll long long

const ll mod=1e9+7;

const int N=1e5+9;

ll vis[N],a[N];

int main()

{

    int t,n,x;

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

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

    {

        scanf("%d",&x);

        vis[x]=1;

    }

    a[0]=1;

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

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

    {

        if(vis[i]) continue;

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

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

    }

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

    return 0;

}
// Slower C++ solution:
//بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ

#include <bits/stdc++.h>

using namespace std;

bool a[100001]{};

long long memo[100001];

int n, m;



long long climb(int i){

    if(memo[i] > -1) return memo[i];

    long long v = 0;

    if(i == n) return 1;

    if(!a[i+1]) v += climb(i+1);

    v %= 1000000007ll;

    if(i < n-1 && !a[i+2]) v += climb(i+2);

    v %= 1000000007ll;

    memo[i] = v;

    return v;

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

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

    cin >> n >> m;

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

        cin >> tmp;

        a[tmp] = true;

    }

    cout << climb(0);

}


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

#define ll long long

const ll mod=1e9+7;

const int N=1e5+9;

ll vis[N],a[N];

int main()

{

    int t,n,x;

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

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

    {

        scanf("%d",&x);

        vis[x]=1;

    }

    a[0]=1;

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

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

    {

        if(vis[i]) continue;

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

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

    }

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

    return 0;

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

#include<string.h>

#include<math.h>

#include<iostream>

#include<algorithm>

#include<queue>

using namespace std;

int a[1000000];

long long sum[1000000];

bool vis[1000000];

int main()

{

    int n,m;

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

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

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

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

    {

        scanf("%d",&a[i]);

        vis[a[i]]=1;

    }

    if(vis[1]==1)

        sum[1]=0;

    else

        sum[1]=1;

    if(vis[2]==1)

        sum[2]=0;

    else

        sum[2]=sum[1]+1;

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

    {

        if(vis[i-1]==0&&vis[i-2]==0)

            sum[i]=sum[i-1]%1000000007+sum[i-2]%1000000007;

        if(vis[i-1]==1&&vis[i-2]==0)

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

        if(vis[i-1]==0&&vis[i-2]==1)

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

        if(vis[i-1]==1&&vis[i-2]==1)

        {

            sum[n]==0;

            break;

        }

    }

    printf("%lld",sum[n]%1000000007);

        return 0;

}


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

#define ll long long

const ll mod=1e9+7;

const int N=1e5+9;

ll vis[N],a[N];

int main()

{

    int t,n,x;

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

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

    {

        scanf("%d",&x);

        vis[x]=1;

    }

    a[0]=1;

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

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

    {

        if(vis[i]) continue;

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

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

    }

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

    return 0;

}
// Slower C++ solution:
//بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ

#include <bits/stdc++.h>

using namespace std;

bool a[100001]{};

long long memo[100001];

int n, m;



long long climb(int i){

    if(memo[i] > -1) return memo[i];

    long long v = 0;

    if(i == n) return 1;

    if(!a[i+1]) v += climb(i+1);

    v %= 1000000007ll;

    if(i < n-1 && !a[i+2]) v += climb(i+2);

    v %= 1000000007ll;

    memo[i] = v;

    return v;

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

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

    cin >> n >> m;

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

        cin >> tmp;

        a[tmp] = true;

    }

    cout << climb(0);

}


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

#define in_range(x, y, r, c) (x < r && y < c && x >= 0 && y >= 0)

using namespace std;

const int mod = 1e9+7;

bool no[100100];

int memo[100100];



int ups(int v){

	if (v == 0) return 1;

	if (v < 1) return 0;

	if (no[v]) return 0;

	if (memo[v] != -1) return memo[v];

	return memo[v] = (ups(v-1) + ups(v-2))%mod;

}



int main(){

	int n, m, aux;

	cin >> n >> m;

	memset(no, false, sizeof no);

	memset(memo, -1, sizeof memo);

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

		cin >> aux;

		no[aux] = true;

	}

	cout << ups(n) << endl;

    return 0;

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

#include<string.h>

#include<math.h>

#include<iostream>

#include<algorithm>

#include<queue>

using namespace std;

int a[1000000];

long long sum[1000000];

bool vis[1000000];

int main()

{

    int n,m;

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

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

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

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

    {

        scanf("%d",&a[i]);

        vis[a[i]]=1;

    }

    if(vis[1]==1)

        sum[1]=0;

    else

        sum[1]=1;

    if(vis[2]==1)

        sum[2]=0;

    else

        sum[2]=sum[1]+1;

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

    {

        if(vis[i-1]==0&&vis[i-2]==0)

            sum[i]=sum[i-1]%1000000007+sum[i-2]%1000000007;

        if(vis[i-1]==1&&vis[i-2]==0)

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

        if(vis[i-1]==0&&vis[i-2]==1)

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

        if(vis[i-1]==1&&vis[i-2]==1)

        {

            sum[n]==0;

            break;

        }

    }

    printf("%lld",sum[n]%1000000007);

        return 0;

}


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

#define in_range(x, y, r, c) (x < r && y < c && x >= 0 && y >= 0)

using namespace std;

const int mod = 1e9+7;

bool no[100100];

int memo[100100];



int ups(int v){

	if (v == 0) return 1;

	if (v < 1) return 0;

	if (no[v]) return 0;

	if (memo[v] != -1) return memo[v];

	return memo[v] = (ups(v-1) + ups(v-2))%mod;

}



int main(){

	int n, m, aux;

	cin >> n >> m;

	memset(no, false, sizeof no);

	memset(memo, -1, sizeof memo);

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

		cin >> aux;

		no[aux] = true;

	}

	cout << ups(n) << endl;

    return 0;

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

typedef long long ll;

using namespace std;

 

const int N = 1e5 + 10 , M = 5e5+10 ,  MOD = 1e9+7;

const int OO = 0x3f3f3f3f;

const double EPS = 1e-3;

 

#define clr(arr,val) memset(arr , val , sizeof (arr))

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

#define rloop(i,n) for(int i = int(n)-1;i >= 0;i--)

#define range(i,a,b) for(int i = int(a);i <= int(b);i++)

#define ALL(v) ((v).begin()) , ((v).end())

#define SZ(v)  ((int)((v).size()))

typedef pair <int,int> pii ;

typedef vector < pii > vii ;

typedef vector < int > vi;

int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction

//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction

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

//freopen("output.txt", "w", stdout);

 





int n, m, x;

int seen[N];

int dp[N];



int solve(int idx){

  

    if(seen[idx]) return 0;

    if(idx == n) return 1;

  //  if(idx > n) return 0;

    int &ret = dp[idx];

    if(~ret) return ret;



   // ret = 0;

    ret = (solve(idx+1) + solve(idx+2))%MOD;



    return ret;





}







 

int main()

{

    

    ios_base::sync_with_stdio(0);

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



    



    cin >> n >> m;

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

        cin >> x;

        seen[x] = 1;

    }





    memset(dp , -1 , sizeof dp);



    ll ans = solve(0);

    cout << ans << "\n";

    



 

    

    return 0;

}


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

#define in_range(x, y, r, c) (x < r && y < c && x >= 0 && y >= 0)

using namespace std;

const int mod = 1e9+7;

bool no[100100];

int memo[100100];



int ups(int v){

	if (v == 0) return 1;

	if (v < 1) return 0;

	if (no[v]) return 0;

	if (memo[v] != -1) return memo[v];

	return memo[v] = (ups(v-1) + ups(v-2))%mod;

}



int main(){

	int n, m, aux;

	cin >> n >> m;

	memset(no, false, sizeof no);

	memset(memo, -1, sizeof memo);

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

		cin >> aux;

		no[aux] = true;

	}

	cout << ups(n) << endl;

    return 0;

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

using namespace std;

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

#define ll long long

#define fastIO cout << fixed << setprecision(12), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)

double const EPS = 1e-12, PI = acos(-1);

const int N = 1e6 + 9, M = 5e3 + 9, OO = 1e9 + 7, MOD = 1e9 + 7;

const ll inf = 1e18;



bool la2[N];

int n, m, a;

ll mem[N];



ll dp(int step) {

  if(step == n)

    return 1;

  if(step > n)

    return 0;

  ll& ret = mem[step];

  if(~ret)

    return ret;

  ret = 0;

  if(!la2[step + 1])

    ret = ((ret % MOD) + (dp(step + 1) % MOD)) % MOD;

  if(!la2[step + 2])

    ret = ((ret % MOD) + (dp(step + 2) % MOD)) % MOD;

  return ret;

}



int main() {

  fastIO;

#ifdef LOCAL

  freopen("input.in", "rt", stdin);

#endif

  cin >> n >> m;

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

    cin >> a;

    la2[a] = 1;

  }

  memset(mem, -1, sizeof mem);

  cout << dp(0);

  return 0;

}

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

#define in_range(x, y, r, c) (x < r && y < c && x >= 0 && y >= 0)

using namespace std;

const int mod = 1e9+7;

bool no[100100];

int memo[100100];



int ups(int v){

	if (v == 0) return 1;

	if (v < 1) return 0;

	if (no[v]) return 0;

	if (memo[v] != -1) return memo[v];

	return memo[v] = (ups(v-1) + ups(v-2))%mod;

}



int main(){

	int n, m, aux;

	cin >> n >> m;

	memset(no, false, sizeof no);

	memset(memo, -1, sizeof memo);

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

		cin >> aux;

		no[aux] = true;

	}

	cout << ups(n) << endl;

    return 0;

}