stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <map>

#include <cstdio>



using std::map;



int n, m, x, m1, m2;



map <int, int> p;



int main() {

	scanf("%d", &n);

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

		scanf("%d", &x);

		p[x] = 1;

	}

	m = p.size();

	

	for(map<int, int>::iterator iter1 = p.begin();iter1 != p.end();iter1 ++)

		m1 ++;

	for(auto iter2 : p) 

		m2 ++;

	if(m1 != m || m2 != m)

		puts("ERROR");

	

	m -= !(m & 1);

	printf("%d", m);

	return 0;

}

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

int cnt[100001];

int arr[100001];

bool left(int index)

{

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

    {

        if (cnt[arr[i]]>1)

        {

            return true;

        }

    }

    return false;

}

void show(int index)

{

    printf("Arr: ");

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

    {

        printf("%d ",arr[i]);

    }

    printf("\n");

    printf("Cnt: ");

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

    {

        printf("%d ",cnt[arr[i]]);

    }

    printf("\n");

}

main()

{

    int n,index=0;

    scanf("%d",&n);

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

    {

        int input;

        scanf("%d",&input);

        if (cnt[input]==0)

        {

            arr[index]=input;

            index++;

        }

        cnt[input]++;

    }

    //show(index);

    while (left(index)==true)

    {

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

        {

            if (cnt[arr[i]]>1)

            {

                cnt[arr[i]]--;

                int mx=-999;

                int keepj;

                for (int j=0;j<index;j++)

                {

                    if (cnt[arr[j]]>mx)

                    {

                        mx = cnt[arr[j]];

                        keepj = j;

                    }

                }

                cnt[arr[keepj]]--;

            }

        }

        //show(index);

    }

    int ans=0;

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

    {

        ans+=cnt[arr[i]];

    }

    printf("%d",ans);



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

#include<queue>

#include<map>

using namespace std;

main()

{

    int num,b;

    queue<int> q;

    map<int,int> m;

    scanf("%d",&num);

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

    {

        scanf("%d",&b);

        m[b]++;

    }

    if(m.size()%2==0) printf("%d\n",m.size()-1);

    else printf("%d\n",m.size());

}


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

int cnt[100001];

int arr[100001];

bool left(int index)

{

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

    {

        if (cnt[arr[i]]>1)

        {

            return true;

        }

    }

    return false;

}

void show(int index)

{

    printf("Arr: ");

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

    {

        printf("%d ",arr[i]);

    }

    printf("\n");

    printf("Cnt: ");

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

    {

        printf("%d ",cnt[arr[i]]);

    }

    printf("\n");

}

main()

{

    int n,index=0;

    scanf("%d",&n);

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

    {

        int input;

        scanf("%d",&input);

        if (cnt[input]==0)

        {

            arr[index]=input;

            index++;

        }

        cnt[input]++;

    }

    //show(index);

    while (left(index)==true)

    {

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

        {

            if (cnt[arr[i]]>1)

            {

                cnt[arr[i]]--;

                int mx=-999;

                int keepj;

                for (int j=0;j<index;j++)

                {

                    if (cnt[arr[j]]>mx)

                    {

                        mx = cnt[arr[j]];

                        keepj = j;

                    }

                }

                cnt[arr[keepj]]--;

            }

        }

        //show(index);

    }

    int ans=0;

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

    {

        ans+=cnt[arr[i]];

    }

    printf("%d",ans);



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

using namespace std;

main()

{

    long n,g,i,j;

    map<long,long> a;

    scanf("%ld",&n);

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

    {

        scanf(" %ld",&g);

        a[g]++;

    }

    printf("%ld",a.size()-(a.size()+1)%2);

}


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

int cnt[100001];

int arr[100001];

bool left(int index)

{

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

    {

        if (cnt[arr[i]]>1)

        {

            return true;

        }

    }

    return false;

}

void show(int index)

{

    printf("Arr: ");

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

    {

        printf("%d ",arr[i]);

    }

    printf("\n");

    printf("Cnt: ");

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

    {

        printf("%d ",cnt[arr[i]]);

    }

    printf("\n");

}

main()

{

    int n,index=0;

    scanf("%d",&n);

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

    {

        int input;

        scanf("%d",&input);

        if (cnt[input]==0)

        {

            arr[index]=input;

            index++;

        }

        cnt[input]++;

    }

    //show(index);

    while (left(index)==true)

    {

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

        {

            if (cnt[arr[i]]>1)

            {

                cnt[arr[i]]--;

                int mx=-999;

                int keepj;

                for (int j=0;j<index;j++)

                {

                    if (cnt[arr[j]]>mx)

                    {

                        mx = cnt[arr[j]];

                        keepj = j;

                    }

                }

                cnt[arr[keepj]]--;

            }

        }

        //show(index);

    }

    int ans=0;

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

    {

        ans+=cnt[arr[i]];

    }

    printf("%d",ans);



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



using namespace std;



int main(){

    int n;

    scanf("%d",&n);

    set<int> a;

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

        int t;

        scanf("%d",&t);

        a.insert(t);

    }

    int s=a.size();

    if(s%2==0) printf("%d\n",s-1);

    else printf("%d\n",s);

    return 0;

}


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

int cnt[100001];

int arr[100001];

bool left(int index)

{

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

    {

        if (cnt[arr[i]]>1)

        {

            return true;

        }

    }

    return false;

}

void show(int index)

{

    printf("Arr: ");

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

    {

        printf("%d ",arr[i]);

    }

    printf("\n");

    printf("Cnt: ");

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

    {

        printf("%d ",cnt[arr[i]]);

    }

    printf("\n");

}

main()

{

    int n,index=0;

    scanf("%d",&n);

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

    {

        int input;

        scanf("%d",&input);

        if (cnt[input]==0)

        {

            arr[index]=input;

            index++;

        }

        cnt[input]++;

    }

    //show(index);

    while (left(index)==true)

    {

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

        {

            if (cnt[arr[i]]>1)

            {

                cnt[arr[i]]--;

                int mx=-999;

                int keepj;

                for (int j=0;j<index;j++)

                {

                    if (cnt[arr[j]]>mx)

                    {

                        mx = cnt[arr[j]];

                        keepj = j;

                    }

                }

                cnt[arr[keepj]]--;

            }

        }

        //show(index);

    }

    int ans=0;

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

    {

        ans+=cnt[arr[i]];

    }

    printf("%d",ans);



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

using namespace std;

int main()

{

    int n;

    int a[200000];

    cin>>n;

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

    {

        cin>>a[i];

    }

    sort(a,a+n);

    int x=unique(a,a+n)-a;

    if(x%2)

    {

        cout<<x;

    }

    else

    {

        cout<<x-1;

    }

    return 0;

}

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

int n;

bool a[100010];

signed main()

{

	scanf("%d",&n);int t,ans(0);bool f(0);

	while(n--)

		scanf("%d",&t),!a[t]?a[t]=1,ans++:f=!f;

	return printf("%d\n",ans-f),0;

}
// Slower C++ solution:
 ///IN THE NAME OF ALLAH

 #include <bits/stdc++.h>

 using namespace std;

 map<int,int>mp;

 int main() {

  int n;

  scanf("%d",&n);

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

   int a;

   scanf("%d",&a);

   mp[a]=1;

  }

  if(mp.size()%2==0)

    cout<<mp.size()-1;

  else cout<<mp.size();

}


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

#include <cstdlib>

#include <cstring>

#include <string>

#include <cmath>

#include <algorithm>

#include <vector>

#include <map>

#include <queue>

#include <set>

using namespace std;

typedef long long LL;

const int MaxN = 1e5;

const int Inf = 1 << 30;



int a[MaxN + 5];



int main()

{

	int n,p;

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

		for(int i = 1;i <= n;i++) scanf("%d",&a[i]);

		sort(a + 1,a + 1 + n);p = 0;

		for(int i = 2;i <= n;i++) if(a[i] == a[i - 1]) p++;

		p = p + (p % 2 == 0 ? 0 : 1);

		printf("%d\n",n - p);

	}

    return 0;

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

#include <algorithm>

using namespace std;



int main()

{

    int n;

    cin >> n;

    int a[n];

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

        cin >> a[i];

    }

    int ans = 0;

    sort (a , a + n);

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

        if (a[i] != a[i + 1]) {

            ans++;

        }

    }

    if (ans % 2 == 0) {

        cout << ans - 1;

    }

    else {

    cout << ans << endl;

    }

    return 0;

}


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

#include <cstdlib>

#include <cstring>

#include <string>

#include <cmath>

#include <algorithm>

#include <vector>

#include <map>

#include <queue>

#include <set>

using namespace std;

typedef long long LL;

const int MaxN = 1e5;

const int Inf = 1 << 30;



int a[MaxN + 5];



int main()

{

	int n,p;

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

		for(int i = 1;i <= n;i++) scanf("%d",&a[i]);

		sort(a + 1,a + 1 + n);p = 0;

		for(int i = 2;i <= n;i++) if(a[i] == a[i - 1]) p++;

		p = p + (p % 2 == 0 ? 0 : 1);

		printf("%d\n",n - p);

	}

    return 0;

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

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



using namespace std;

using namespace __gnu_pbds;



#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key



typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<int>::iterator sit;

typedef map<int,int>::iterator mit;

typedef vector<int>::iterator vit;



deque<int> dq;

map<int,int> ma;

bool marked[100001];

void rem(int x)

{

	ma[x]--;

	if(ma[x]==0) ma.erase(x);

}



int main()

{

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

	int n; cin>>n;

	dq.resize(n);

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

	{

		cin>>dq[i];

		ma[dq[i]]++;

	}

	int ans = ma.size();

	if(ans%2==0) ans--;

	cout<<ans<<'\n';

	return 0;

	while(!dq.empty())

	{

		cerr<<ma.size()<<' '<<dq.size()<<'\n';

		if(ma.size()==dq.size())

		{

			cout<<ma.size()<<'\n';

			return 0;

		}

		int a[3];

		a[0]=dq.front();

		dq.pop_front();

		a[1]=dq.front();

		dq.pop_front();

		a[2]=dq.front();

		dq.pop_front();

		cerr<<a[0]<<' '<<a[1]<<' '<<a[2]<<'\n';

		sort(a,a+3);

		//cerr<<a[0]<<' '<<a[1]<<' '<<a[2]<<'\n';

		rem(a[0]);

		rem(a[2]);

		rem(a[1]);

		if(!marked[a[1]])

		{

			marked[a[1]]=1;

			dq.push_back(a[1]);

		}

		else

		{

			dq.push_front(a[1]);

		}

		

		ma[a[1]]++;

	}

}


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

#include <cstdlib>

#include <cstring>

#include <string>

#include <cmath>

#include <algorithm>

#include <vector>

#include <map>

#include <queue>

#include <set>

using namespace std;

typedef long long LL;

const int MaxN = 1e5;

const int Inf = 1 << 30;



int a[MaxN + 5];



int main()

{

	int n,p;

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

		for(int i = 1;i <= n;i++) scanf("%d",&a[i]);

		sort(a + 1,a + 1 + n);p = 0;

		for(int i = 2;i <= n;i++) if(a[i] == a[i - 1]) p++;

		p = p + (p % 2 == 0 ? 0 : 1);

		printf("%d\n",n - p);

	}

    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: 2.229847808599897x):
#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;

}
// 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: 3.0555459657144275x):
#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;

}
// 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.4087894718093816x):
#include <iostream>

#include <cstdio>

using namespace std;

const long long mod = 1000000007LL, neg_INF = -0x7f7f7f7f7f7f7f7fLL;

int n, m;

long long way[101000];

int main(){

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

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

		scanf("%d", &x);

		way[x] = neg_INF;

	}

	if( way[1] != neg_INF )

		way[1] = 1LL;

	if( way[2] != neg_INF ){

		way[2] = 1LL;

		if( way[1] != neg_INF )

			way[2] = 2LL;

	}

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

		if( way[i] == neg_INF )

			continue;

		if( way[i-1] != neg_INF )

			way[i] += way[i-1], way[i] %= mod;

		if( way[i-2] != neg_INF )

			way[i] += way[i-2], way[i] %= mod;

	}

	printf("%lld\n", way[n] == neg_INF ? 0 : way[n]);

	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.9304550608908826x):
#include <iostream>

#include <cstdio>

using namespace std;

const long long mod = 1000000007LL, neg_INF = -0x7f7f7f7f7f7f7f7fLL;

int n, m;

long long way[101000];

int main(){

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

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

		scanf("%d", &x);

		way[x] = neg_INF;

	}

	if( way[1] != neg_INF )

		way[1] = 1LL;

	if( way[2] != neg_INF ){

		way[2] = 1LL;

		if( way[1] != neg_INF )

			way[2] = 2LL;

	}

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

		if( way[i] == neg_INF )

			continue;

		if( way[i-1] != neg_INF )

			way[i] += way[i-1], way[i] %= mod;

		if( way[i-2] != neg_INF )

			way[i] += way[i-2], way[i] %= mod;

	}

	printf("%lld\n", way[n] == neg_INF ? 0 : way[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.3827839740567553x):
#include <bits/stdc++.h>



using namespace std;



const int mod = 1e9+7;

const int maxn = 1e5+10;



long long dp[maxn];



int main(){



	int n,m;



	cin >> n >> m;



	bitset<maxn> mp;



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

		cin >> x;

		mp[x] = 1;

	}



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

	dp[2] = (mp[2] ? 0 : mp[1] ? 1 : 2);



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

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

	}



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



	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.8948198962675509x):
#include <bits/stdc++.h>



using namespace std;



const int mod = 1e9+7;

const int maxn = 1e5+10;



long long dp[maxn];



int main(){



	int n,m;



	cin >> n >> m;



	bitset<maxn> mp;



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

		cin >> x;

		mp[x] = 1;

	}



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

	dp[2] = (mp[2] ? 0 : mp[1] ? 1 : 2);



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

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

	}



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



	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.3488063245590916x):
#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;

}
// 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.393421125708789x):
#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;

}