#include <bits/stdc++.h>

using namespace std;

constexpr int MOD = 998244353, MAXN = 200000;

int comp[MAXN + 2], aux[MAXN + 2], dp[MAXN + 2], robot[MAXN + 2][2], bit[MAXN + 2];

int cl = 0;
int getidx(int x) {
	return lower_bound(comp, comp + cl, x) - comp;
}

int reduce(int x) {
	return x >= MOD ? x - MOD : x;
}

int main() {
	int N;
	cin >> N;
	for(int i = 0; i < N; i++) {
		cin >> robot[i][0] >> robot[i][1];
		comp[cl++] = robot[i][0];
	}
	sort(comp, comp + cl);
	cl = unique(comp, comp + cl) - comp;
	for(int i = 0; i < N; i++)
		aux[getidx(robot[i][0])] = getidx(robot[i][0] + robot[i][1]);
	for(int i = N - 1; i >= 0; i--) {
		for(int j = i + 1; j <= N; j += j &- j)
			bit[j] = max(bit[j], aux[i + 1]);
		int res = aux[i];
		for(int j = aux[i] - 1; j > 0; j ^= j &- j)
			res = max(res, bit[j]);
		aux[i] = res;
	}
	dp[N] = 1;
	for(int i = N - 1; i >= 0; i--)
		dp[i] = reduce(dp[i + 1] + dp[aux[i]]);
	cout << dp[0] << '\n';
}
