#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#define F first
#define S second
using namespace std;
typedef long long ll;
#define PR pair<ll, ll>

int n, d[200005], M=998244353;
PR a[200005];
stack<PR> st;
int main() {
	int i;
	cin >> n;
	d[n] = 1;
	st.push({1e9, n});
	for(i=0; i<n; i++) scanf("%lld%lld", &a[i].F, &a[i].S);
	sort(a, a+n);
	for(i=n-1; i>=0; i--) {
		while(a[i].F + a[i].S > st.top().F) st.pop();
		d[i] = (d[i+1] + d[st.top().S]) % M;
		st.push({a[i].F, i});
	}
	cout << d[0];
	return 0;
}