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

#define MAX_N 200000 + 1

using namespace std;



int N, number[MAX_N], ans[MAX_N];



bool check(){

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

		int cnt = 0;

		for(int j = i; j <= N; j += i)

			cnt += ans[j];

		cnt %= 2;

		if(cnt ^ number[i]) return false;

	}

	return true;

}



int main(){

	ios::sync_with_stdio(false);

	cin.tie(0);

	

	while(cin >> N){

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

			cin >> number[i];

		

		for(int i = N; i > 0; i--){

			int cnt = 0;

			for(int j = i; j <= N; j += i)

				cnt += ans[j];

			cnt %= 2;

			ans[i] = cnt ^ number[i];

		}

		

		if(check()){

			int sum = 0;

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

				if(ans[i]) sum++;

			cout << sum << endl;

			if(sum){

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

					if(ans[i]) cout << i << " ";

				cout << endl;

			}

		}

		else

			cout << -1 << endl;

		

		memset(number, 0, sizeof(number));

		memset(ans, 0, sizeof(ans));

	}

	

	return 0;

}

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

using namespace std ;







int main(){

    bool v[200100] ;

    int n,z ;

    cin >> n ;

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

        cin >> v[i] ;

    }

    for(int i=n-1 ; i>0 ; i--){

        if(v[i] == 1){

         // here

         z = i +1 ;

             for (int j=1; j<=sqrt(z); j++)

                {

                    if (z%j == 0)

                    {

                        // If divisors are equal, print only one

                        if (z/j == j)

                            //printf("%d ", i);

                            v[j-1] = -1*(v[j-1]) +1 ;



                        else {

                             v[j-1] = -1*(v[j-1]) +1 ;

                             v[(z/j)-1] = -1*(v[(z/j)-1]) +1 ;

                        }// Otherwise print both

                            //printf("%d %d ", i, n/i);

                    }

                }



          // end

          v[i] = 1 ;

        }







    }

    int ans =0 ;

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

        if(v[i] == 1){

            ans ++ ;

        }

    }

    cout << ans << endl ;

    if(ans != 0){

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

            if(v[i] == 1){

                cout << i+1 << " " ;

            }

        }

    }



    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 __gnu_pbds;

using namespace std;

#define Khela ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long int

#define llu long long unsigned int

#define pf printf

#define sf scanf

#define f first

#define s second

#define pb push_back

#define mk make_pair

#define pii pair<int ,int>

#define PII pair<ll ,ll>

 

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};

int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int dx4[] = {0, 0, 1, -1};

int dy4[] = {1, -1, 0, 0};

 

typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

int Set(int N,int pos){return N=N | (1<<pos);}

int reset(int N,int pos){return N= N & ~(1<<pos);}

bool check(int N,int pos){return (bool)(N & (1<<pos));}

const int max=1e9+100;

const ll  MAX=1e18+500;

const int sz=2e5+100;

int mark[sz];

vector<int> test;

int main()

{

    Khela

    int a,b,c,i,j,k,q,p,x,y,ct,ct1,m,l,r,x1,y1,mn,h,sum1,in,z,mid,n,mx;

    char ch;

    double d;

    string str1,str2,str;

    bool bl,bl1;

    int t,cs=1;

    while(cin>>n)

    {

        test.clear();

        memset(mark,0,sizeof mark);

        int ara[n+2];

        for(i=1;i<=n;i++) cin>>ara[i];



        int ct=0;

        for(i=n;i>=1;i--){

            p=mark[i];

            x=0;

            if(p%2 != ara[i]) ++x,++ct,test.pb(i);

            if(x>0){

                int sq=sqrt(i);

                for(j=1;j<=sq;j++){

                    if(i%j==0){

                        ++mark[j];

                        if(j*j != i) ++mark[i/j];

                    }

                }

            }

        }

        reverse(test.begin(),test.end());

        cout<<ct<<endl;

        if(test.size()>0){

        for(auto xx: test) cout<<xx<<" ";

        cout<<endl;

        }

      

        

    }











}

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

#include <fstream>

#include <sstream>

#include <iomanip>

#include <algorithm>

#include <numeric>

#include <vector>

#include <string>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <climits>

#include <cmath>

#include <cstring>

#include <unordered_set>

#include <unordered_map>

using namespace std;



#define pb push_back

#define fst first

#define snd second



typedef long long ll;

typedef pair<int,int> pii;

template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T>>;



const ll MOD=1e9+7;



int N;

int a[200100];

int b[200100];



int main(){

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



  cin>>N;

  for(int i=1;i<=N;i++) cin>>a[i];

  vector<int> res;

  for(int i=N;i>=1;i--){

    int s=0;

    for(int j=N/i*i;j>i;j-=i) s+=b[j];

    b[i] = (s&1)^a[i];

    if (b[i]) res.pb(i);

  }

  cout<<res.size()<<endl;

  for(int k:res) cout<<k<<" ";

  cout<<endl;



  return 0;

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

#define maxn 200005

using namespace std;



int arr[maxn], box[maxn];

vector<int> ans;

int n;



int main() {

    scanf("%d", &n);

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

        scanf("%d", arr + i);

    }

    ans.clear();

    memset(box, 0, sizeof(box));

    for(int i = n; i > 0; i--) {

        int sum = 0;

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

            sum += box[j];

        }

        if(sum % 2 != arr[i]) box[i] = 1;

        if(box[i]) ans.push_back(i);

    }

    printf("%d\n", (int)ans.size());

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

        printf("%d%c", ans[i], " \n"[i == (int)ans.size() - 1]);

    }

    return 0;

}


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

#include <fstream>

#include <sstream>

#include <iomanip>

#include <algorithm>

#include <numeric>

#include <vector>

#include <string>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <climits>

#include <cmath>

#include <cstring>

#include <unordered_set>

#include <unordered_map>

using namespace std;



#define pb push_back

#define fst first

#define snd second



typedef long long ll;

typedef pair<int,int> pii;

template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T>>;



const ll MOD=1e9+7;



int N;

int a[200100];

int b[200100];



int main(){

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



  cin>>N;

  for(int i=1;i<=N;i++) cin>>a[i];

  vector<int> res;

  for(int i=N;i>=1;i--){

    int s=0;

    for(int j=N/i*i;j>i;j-=i) s+=b[j];

    b[i] = (s&1)^a[i];

    if (b[i]) res.pb(i);

  }

  cout<<res.size()<<endl;

  for(int k:res) cout<<k<<" ";

  cout<<endl;



  return 0;

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

#define MAX_N 200000 + 1

using namespace std;



int N, number[MAX_N], ans[MAX_N];



bool check(){

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

		int cnt = 0;

		for(int j = i; j <= N; j += i)

			cnt += ans[j];

		cnt %= 2;

		if(cnt ^ number[i]) return false;

	}

	return true;

}



int main(){

	ios::sync_with_stdio(false);

	cin.tie(0);

	

	while(cin >> N){

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

			cin >> number[i];

		

		for(int i = N; i > 0; i--){

			int cnt = 0;

			for(int j = i; j <= N; j += i)

				cnt += ans[j];

			cnt %= 2;

			ans[i] = cnt ^ number[i];

		}

		

		if(check()){

			int sum = 0;

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

				if(ans[i]) sum++;

			cout << sum << endl;

			if(sum){

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

					if(ans[i]) cout << i << " ";

				cout << endl;

			}

		}

		else

			cout << -1 << endl;

		

		memset(number, 0, sizeof(number));

		memset(ans, 0, sizeof(ans));

	}

	

	return 0;

}

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

#include <fstream>

#include <sstream>

#include <iomanip>

#include <algorithm>

#include <numeric>

#include <vector>

#include <string>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <climits>

#include <cmath>

#include <cstring>

#include <unordered_set>

#include <unordered_map>

using namespace std;



#define pb push_back

#define fst first

#define snd second



typedef long long ll;

typedef pair<int,int> pii;

template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T>>;



const ll MOD=1e9+7;



int N;

int a[200100];

int b[200100];



int main(){

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



  cin>>N;

  for(int i=1;i<=N;i++) cin>>a[i];

  vector<int> res;

  for(int i=N;i>=1;i--){

    int s=0;

    for(int j=N/i*i;j>i;j-=i) s+=b[j];

    b[i] = (s&1)^a[i];

    if (b[i]) res.pb(i);

  }

  cout<<res.size()<<endl;

  for(int k:res) cout<<k<<" ";

  cout<<endl;



  return 0;

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

using ll = long long;

using namespace std;

ll mod=1e9+7;



int main(){

  int N;

  ll a[300001];

  ll b[300001];

  int cnt(0);

  cin>>N;

  for (int i(1);i<=N;i++)cin>>b[i];

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

    a[i]=b[i];

    if (a[i]==1)cnt+=1;

  }

  for (int i(N/2);i>0;i--){

    // a[i] is needed

    int sum(0);

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

      sum+=a[j];

    }

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

    if (sum%2==b[i]) a[i]=0;

    else {

      a[i]=1;

      cnt+=1;

    }

  }



  cout << cnt << endl;

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

    if (a[i]==1){

      cout << i << endl;

    }

  }

  return 0;

}


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



using ll = long long;

using namespace std;

const int INFint = 2e9+1;

const ll INFll = 2e18+1;

ll MOD=1e9+7;



int main(){

  int N;

  cin>>N;

  vector<int> A(N+1);

  for(int i(1);i<=N;i++) cin>>A[i];

  vector<int> ans(N+1);

  int cnt(0);

  for(int i(N);i>=1;i--){

    int tmp(i);

    int tmpi(0);

    while(N >= tmp){

      tmpi += ans[tmp];

      tmp += i;

    }

    //cout << tmpi << endl;

    if(A[i] != tmpi%2){

      ans[i] = 1;

      cnt++;

    }

    else ans[i] = 0;

  }

  cout << cnt << endl;

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

    if(ans[i]) cout << i << " ";

  }

  cout << endl;

  return 0;

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

using ll = long long;

using namespace std;

ll mod=1e9+7;



int main(){

  int N;

  ll a[300001];

  ll b[300001];

  int cnt(0);

  cin>>N;

  for (int i(1);i<=N;i++)cin>>b[i];

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

  //   a[i]=b[i];

  //   if (a[i]==1)cnt+=1;

  // }

  for (int i(N);i>0;i--){

    // a[i] is needed

    int sum(0);

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

      sum+=a[j];

    }

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

    if (sum%2==b[i]) a[i]=0;

    else {

      a[i]=1;

      cnt+=1;

    }

  }



  cout << cnt << endl;

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

    if (a[i]==1){

      cout << i << endl;

    }

  }

  return 0;

}


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



using ll = long long;

using namespace std;

const int INFint = 2e9+1;

const ll INFll = 2e18+1;

ll MOD=1e9+7;



int main(){

  int N;

  cin>>N;

  vector<int> A(N+1);

  for(int i(1);i<=N;i++) cin>>A[i];

  vector<int> ans(N+1);

  int cnt(0);

  for(int i(N);i>=1;i--){

    int tmp(i);

    int tmpi(0);

    while(N >= tmp){

      tmpi += ans[tmp];

      tmp += i;

    }

    //cout << tmpi << endl;

    if(A[i] != tmpi%2){

      ans[i] = 1;

      cnt++;

    }

    else ans[i] = 0;

  }

  cout << cnt << endl;

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

    if(ans[i]) cout << i << " ";

  }

  cout << endl;

  return 0;

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



#define fr first

#define sc second

#define mk make_pair

#define pb push_back

#define pf push_front

#define pii pair <int ,int>

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

#define int long long



using namespace std;



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



int n, a, b, dp[2][N], l = 1, ar[N], L[N];



main()

{

    cin >> n >> a >> b;



    if (a > b) swap(a, b);



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



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

        scanf("%lld", &ar[i]);



    L[1] = 1;



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

    {

        if ( ar[i] - ar[i - 1] >= a )

            L[i] = L[i - 1];

        else

            L[i] = i;

    }

    ar[0] = -1e18;



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

    {

        if (ar[i] - ar[i - 1] >= a)

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



        else if (ar[i] - ar[i - 2] >= a)

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



        else if (i > 2)

        {

            puts("0");

            return 0;

        }



        while (ar[i] - ar[l] >= b) l++;



        if (l == i)

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



        else if ( L[i - 1] <= l)

            dp[1][i] = dp[0][l];

    }

    cout << ( dp[1][n] + dp[0][n] ) % mod;

}


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

#include<algorithm>

using namespace std;

long long n,f[200000],mod=1000000007,a,b,s[200000];

int main()

{

	scanf("%lld%lld%lld",&n,&a,&b);

	for(int i=1;i<=n;i++)scanf("%lld",s+i);

	if(a>b)swap(a,b);

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

		if(s[i+1]-s[i-1]<a){puts("0");return 0;}

	f[0]=1;s[0]=-b;

	long long sum=0,r=0;int u=0;



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

	{

		for(;r<i&&s[i]-s[r]>=b;r++)sum=(sum+f[r])%mod;

		f[i]=sum;

		if(s[i]-s[i-1]<a)sum=0,r=i-1;

	}

	for(int i=r;i<=n;i++)sum=(sum+f[i])%mod;

	printf("%lld\n",sum);

	return 0;

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

#include<cstdio>

#include<cstdlib>

#include<cstring>

using namespace std;

int n;

long long a,b;

long long e[100010];

int lsta[100010],lstb[100010];

long long dp1[100010],dp2[100010];

const long long md=1e9+7;

int lst1,lst2;

void pls(long long& x,long long y)

{

	x+=y;

	if(x>md)x-=md;

}

int main()

{

	scanf("%d%lld%lld",&n,&a,&b);

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

	{

		scanf("%lld",e+i);

	}

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

	{

		for(lsta[i]=lsta[i-1];e[lsta[i]+1]+a<=e[i];lsta[i]++);

		for(lstb[i]=lstb[i-1];e[lstb[i]+1]+b<=e[i];lstb[i]++);

	}

	dp1[0]=dp2[0]=1;

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

	{

		long long ax=dp2[min(i-2,lsta[i])],ay=dp1[min(i-2,lstb[i])];

		if(lsta[i]!=i-1)

		{

			for(int j=lst1;j<=i-2;j++)dp1[j]=0;

			lst1=i-1;

		}

		if(lstb[i]!=i-1)

		{

			for(int j=lst2;j<=i-2;j++)dp2[j]=0;

			lst2=i-1;

		}

		pls(dp1[i-1],ax+dp1[i-2]);

		pls(dp2[i-1],ay+dp2[i-2]);

	}

	long long ans=(dp1[n-1]+dp2[n-1])%md;

	printf("%lld",ans);

	return 0;

}

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

#include<algorithm>

using namespace std;

long long n,f[200000],mod=1000000007,a,b,s[200000];

int main()

{

	scanf("%lld%lld%lld",&n,&a,&b);

	for(int i=1;i<=n;i++)scanf("%lld",s+i);

	if(a>b)swap(a,b);

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

		if(s[i+1]-s[i-1]<a){puts("0");return 0;}

	f[0]=1;s[0]=-b;

	long long sum=0,r=0;int u=0;



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

	{

		for(;r<i&&s[i]-s[r]>=b;r++)sum=(sum+f[r])%mod;

		f[i]=sum;

		if(s[i]-s[i-1]<a)sum=0,r=i-1;

	}

	for(int i=r;i<=n;i++)sum=(sum+f[i])%mod;

	printf("%lld\n",sum);

	return 0;

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



#define fr first

#define sc second

#define mk make_pair

#define pb push_back

#define pf push_front

#define pii pair <int ,int>

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

#define int long long



using namespace std;



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



int n, a, b, dp[2][N], l = 1, ar[N], L[N];



main()

{

    cin >> n >> a >> b;



    if (a > b) swap(a, b);



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



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

        scanf("%lld", &ar[i]);



    L[1] = 1;



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

    {

        if ( ar[i] - ar[i - 1] >= a )

            L[i] = L[i - 1];

        else

            L[i] = i;

    }

    ar[0] = -1e18;



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

    {

        if (ar[i] - ar[i - 1] >= a)

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



        else if (ar[i] - ar[i - 2] >= a)

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



        else if (i > 2)

        {

            puts("0");

            return 0;

        }



        while (ar[i] - ar[l] >= b) l++;



        if (l == i)

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



        else if ( L[i - 1] <= l)

            dp[1][i] = dp[0][l];

    }

    cout << ( dp[1][n] + dp[0][n] ) % mod;

}


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

#include <algorithm>

using namespace std;

const int MAXN=1010000;

const int MOD=1e9+7;

long long n,a,b;

long long c[MAXN];

long long f[MAXN],s[MAXN];

int main()

{

//	freopen("test.in","r",stdin);

//	freopen("test.out","w",stdout);

    scanf("%lld%lld%lld",&n,&a,&b);

    if(a>b)swap(a,b);

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

    {

        scanf("%lld",&c[i]);

        if(i>2&&c[i]-c[i-2]<a)

        {

            printf("0");

            return 0;

        }

    }	

    f[0]=s[0]=1;

    for(int i=1,l=0,r=0;i<=n;i++)

    {

        while(i>1&&c[i]-c[r+1]>=b)r++;

        if(l<=r)

        {	

            f[i]=s[r];

            if(l!=0)f[i]=(f[i]+MOD-s[l-1])%MOD;

        }

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

        if(i>1&&c[i]-c[i-1]<a)l=i-1;

    }

    long long ans=0;

    for(int i=n;i>=0;i--)

    {

        ans=(ans+f[i])%MOD;

        if(i<n&&a>c[i+1]-c[i])break;

    }

    printf("%lld",ans);

    return 0;

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

#include<cstdio>

#include<cstdlib>

#include<cstring>

using namespace std;

int n;

long long a,b;

long long e[100010];

int lsta[100010],lstb[100010];

long long dp1[100010],dp2[100010];

const long long md=1e9+7;

int lst1,lst2;

void pls(long long& x,long long y)

{

	x+=y;

	if(x>md)x-=md;

}

int main()

{

	scanf("%d%lld%lld",&n,&a,&b);

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

	{

		scanf("%lld",e+i);

	}

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

	{

		for(lsta[i]=lsta[i-1];e[lsta[i]+1]+a<=e[i];lsta[i]++);

		for(lstb[i]=lstb[i-1];e[lstb[i]+1]+b<=e[i];lstb[i]++);

	}

	dp1[0]=dp2[0]=1;

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

	{

		long long ax=dp2[min(i-2,lsta[i])],ay=dp1[min(i-2,lstb[i])];

		if(lsta[i]!=i-1)

		{

			for(int j=lst1;j<=i-2;j++)dp1[j]=0;

			lst1=i-1;

		}

		if(lstb[i]!=i-1)

		{

			for(int j=lst2;j<=i-2;j++)dp2[j]=0;

			lst2=i-1;

		}

		pls(dp1[i-1],ax+dp1[i-2]);

		pls(dp2[i-1],ay+dp2[i-2]);

	}

	long long ans=(dp1[n-1]+dp2[n-1])%md;

	printf("%lld",ans);

	return 0;

}

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

#include <algorithm>

using namespace std;

const int MAXN=1010000;

const int MOD=1e9+7;

long long n,a,b;

long long c[MAXN];

long long f[MAXN],s[MAXN];

int main()

{

//	freopen("test.in","r",stdin);

//	freopen("test.out","w",stdout);

    scanf("%lld%lld%lld",&n,&a,&b);

    if(a>b)swap(a,b);

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

    {

        scanf("%lld",&c[i]);

        if(i>2&&c[i]-c[i-2]<a)

        {

            printf("0");

            return 0;

        }

    }	

    f[0]=s[0]=1;

    for(int i=1,l=0,r=0;i<=n;i++)

    {

        while(i>1&&c[i]-c[r+1]>=b)r++;

        if(l<=r)

        {	

            f[i]=s[r];

            if(l!=0)f[i]=(f[i]+MOD-s[l-1])%MOD;

        }

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

        if(i>1&&c[i]-c[i-1]<a)l=i-1;

    }

    long long ans=0;

    for(int i=n;i>=0;i--)

    {

        ans=(ans+f[i])%MOD;

        if(i<n&&a>c[i+1]-c[i])break;

    }

    printf("%lld",ans);

    return 0;

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



#define fr first

#define sc second

#define mk make_pair

#define pb push_back

#define pf push_front

#define pii pair <int ,int>

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

#define int long long



using namespace std;



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



int n, a, b, dp[2][N], l = 1, ar[N], L[N];



main()

{

    cin >> n >> a >> b;



    if (a > b) swap(a, b);



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



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

        scanf("%lld", &ar[i]);



    L[1] = 1;



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

    {

        if ( ar[i] - ar[i - 1] >= a )

            L[i] = L[i - 1];

        else

            L[i] = i;

    }

    ar[0] = -1e18;



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

    {

        if (ar[i] - ar[i - 1] >= a)

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



        else if (ar[i] - ar[i - 2] >= a)

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



        else if (i > 2)

        {

            puts("0");

            return 0;

        }



        while (ar[i] - ar[l] >= b) l++;



        if (l == i)

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



        else if ( L[i - 1] <= l)

            dp[1][i] = dp[0][l];

    }

    cout << ( dp[1][n] + dp[0][n] ) % mod;

}


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

using namespace std;

const int N=100005;

const int mod=1000000007;

int n,i,j,l,r;

int f[N],p[N];

long long s[N],a,b;

int main()

{

	scanf("%d",&n);

	scanf("%lld%lld",&a,&b);

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

		scanf("%lld",&s[i]);

	if (a>b)

		a^=b^=a^=b;

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

		if (s[i]-s[i-2]<a)

		{

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

			return 0;

		}

	f[0]=1;

	p[0]=1;

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

	{

		while (r<i-1&&s[i]-s[r+1]>=b)

			r++;

		if (l<=r)

			f[i]=(p[r]+mod-(l?p[l-1]:0))%mod;

		p[i]=(p[i-1]+f[i])%mod;

		if (i>1&&s[i]-s[i-1]<a)

			l=i-1;

	}

	for (i=n;i>=1;i--)

		if (i<n&&s[i+1]-s[i]<a)

			break;

	printf("%d\n",(p[n]+mod-(i?p[i-1]:0))%mod);

	return 0;

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

#include<cstdio>

#include<cstdlib>

#include<cstring>

using namespace std;

int n;

long long a,b;

long long e[100010];

int lsta[100010],lstb[100010];

long long dp1[100010],dp2[100010];

const long long md=1e9+7;

int lst1,lst2;

void pls(long long& x,long long y)

{

	x+=y;

	if(x>md)x-=md;

}

int main()

{

	scanf("%d%lld%lld",&n,&a,&b);

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

	{

		scanf("%lld",e+i);

	}

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

	{

		for(lsta[i]=lsta[i-1];e[lsta[i]+1]+a<=e[i];lsta[i]++);

		for(lstb[i]=lstb[i-1];e[lstb[i]+1]+b<=e[i];lstb[i]++);

	}

	dp1[0]=dp2[0]=1;

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

	{

		long long ax=dp2[min(i-2,lsta[i])],ay=dp1[min(i-2,lstb[i])];

		if(lsta[i]!=i-1)

		{

			for(int j=lst1;j<=i-2;j++)dp1[j]=0;

			lst1=i-1;

		}

		if(lstb[i]!=i-1)

		{

			for(int j=lst2;j<=i-2;j++)dp2[j]=0;

			lst2=i-1;

		}

		pls(dp1[i-1],ax+dp1[i-2]);

		pls(dp2[i-1],ay+dp2[i-2]);

	}

	long long ans=(dp1[n-1]+dp2[n-1])%md;

	printf("%lld",ans);

	return 0;

}

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

using namespace std;

const int N=100005;

const int mod=1000000007;

int n,i,j,l,r;

int f[N],p[N];

long long s[N],a,b;

int main()

{

	scanf("%d",&n);

	scanf("%lld%lld",&a,&b);

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

		scanf("%lld",&s[i]);

	if (a>b)

		a^=b^=a^=b;

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

		if (s[i]-s[i-2]<a)

		{

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

			return 0;

		}

	f[0]=1;

	p[0]=1;

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

	{

		while (r<i-1&&s[i]-s[r+1]>=b)

			r++;

		if (l<=r)

			f[i]=(p[r]+mod-(l?p[l-1]:0))%mod;

		p[i]=(p[i-1]+f[i])%mod;

		if (i>1&&s[i]-s[i-1]<a)

			l=i-1;

	}

	for (i=n;i>=1;i--)

		if (i<n&&s[i+1]-s[i]<a)

			break;

	printf("%d\n",(p[n]+mod-(i?p[i-1]:0))%mod);

	return 0;

}