#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ar array
 
const int mxN=2e5, M=998244353;
int n;
ar<int, 2> a[mxN];
ll dp[mxN+1];
 
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
 
	cin >> n;
	for(int i=0; i<n; ++i)
		cin >> a[i][0] >> a[i][1];
	sort(a, a+n);
	dp[n]=1;
	vector<ar<int, 2>> st{{n, (int)2e9}};
	for(int i=n-1; ~i; --i) {
		//int p=lower_bound(a, a+n, ar<int, 2>{a[i][0]+a[i][1], 0})-a;
		//dp[i]=dp[p];
		while(st.back()[1]<a[i][0]+a[i][1])
			st.pop_back();
		int p=st.back()[0];
		dp[i]=dp[p];
		st.push_back({i, a[i][0]});
		//cout << i << " " << p << endl;
		dp[i]=(dp[i]+dp[i+1])%M;
	}
	cout << dp[0];
}
// not my code but nice ans





