#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<vector>
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int N=2e5+5;
const ll mod=998244353;
template<class T>inline void read(T &res)
{
char c;T flag=1;
while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;res=c-'0';
while((c=getchar())>='0'&&c<='9')res=res*10+c-'0';res*=flag;
}
struct node{
	ll x,d;
	bool operator<(const node &t)const{
		return x<t.x;
	}
};
node a[N];
stack<node>s;
int n;
ll dp[N];
int main(){
	read(n);
	for(int i=1;i<=n;i++)read(a[i].x),read(a[i].d);
	sort(a+1,a+1+n);
	dp[n+1]=1;
	for(int i=n;i;i--){
		int t=a[i].x+a[i].d;
		int idx=i+1;
		while(!s.empty()&&t>a[s.top().x].x){
			idx=s.top().d;
			s.pop();
		}
		node tmp;tmp.x=i;tmp.d=idx;
		s.push(tmp);
		dp[i]=(dp[i+1]+dp[idx])%mod;
	}
	cout<<dp[1]<<endl;
	return 0;
}
