#include<bits/stdc++.h>
using namespace std;
constexpr long long mod=998244353;

int N,R[200000],tree[1<<19];
long long DP[200001];
pair<int,int>P[200000];

void update(int x,int t){
	x+=1<<18;
	while(x){
		tree[x]=max(tree[x],t);
		x/=2;
	}
}

int calc(int l,int r){
	int a=0;
	l+=1<<18;
	r+=1<<18;
	while(l<=r){
		a=max({a,tree[l],tree[r]});
		l=(l+1)/2;
		r=(r-1)/2;
	}
	return a;
}

int main(){
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>P[i].first>>P[i].second;
	}
	sort(P,P+N);
	for(int i=N-1;i>=0;i--){
		update(i,max(i,calc(i,lower_bound(P,P+N,pair<int,int>{P[i].first+P[i].second,-1})-P-1)));
	}
	DP[0]=1;
	for(int i=0;i<N;i++){
		DP[i+1]+=DP[i];
		DP[i+1]%=mod;
		DP[tree[i+(1<<18)]+1]+=DP[i];
		DP[tree[i+(1<<18)]+1]%=mod;
	}
	cout<<DP[N]<<endl;
}
