#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define int long long
#define endl '\n'
#define INF 1000000000000000000
#define EPS 1e-10
#define PI 3.141592653589793238
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define fi first
#define se second
#define pb push_back
#define double long double
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
typedef complex<double> com;
template<class T, class S> bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class S> bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }

ll mod = 998244353;

template<class T>
class lazysegtree {
	int n;
	vector<T> data, lazy;
	vector<bool> lazyflag;
	T def;
	function<T(T, T)> operation;
	function<T(T, T)> update;
public:
	lazysegtree(size_t _n, T _def, function<T(T, T)> _operation, function<T(T, T)> _update)
		:def(_def), operation(_operation), update(_update) {
		n = 1;
		while (n < _n) {
			n *= 2;
		}
		data = vector<T>(2 * n - 1, def);
		lazy = vector<T>(2 * n - 1, def);
		lazyflag = vector<bool>(2 * n - 1, false);
	}
	void eval(int k, int l, int r) {
		if (lazyflag[k]) {
			data[k] = lazy[k];
			if (r - l > 1) {
				lazy[2 * k + 1] = lazy[k];
				lazy[2 * k + 2] = lazy[k];
				lazyflag[2 * k + 1] = lazyflag[2 * k + 2] = true;
			}
			lazyflag[k] = false;
		}
	}
	void lazychange(int a, int b, int x, int k = 0, int l = 0, int r = -1) {
		if (r < 0) r = n;
		eval(k, l, r);
		if (b <= l || r <= a) return;
		if (a <= l && r <= b) {
			lazy[k] = x;
			lazyflag[k] = true;
			eval(k, l, r);
		}
		else {
			lazychange(a, b, x, 2 * k + 1, l, (l + r) / 2);
			lazychange(a, b, x, 2 * k + 2, (l + r) / 2, r);
			data[k] = operation(data[2 * k + 1], data[2 * k + 2]);
		}
	}
	void change(int i, T x) {
		i += n - 1;
		data[i] = update(data[i], x);
		while (i > 0) {
			i = (i - 1) / 2;
			data[i] = operation(data[i * 2 + 1], data[i * 2 + 2]);
		}
	}
	T query(int a, int b, int k = 0, int l = 0, int r = -1) {
		if (r < 0) r = n;
		eval(k, l, r);
		if (b <= l || r <= a) return def;
		if (a <= l && r <= b) return data[k];
		int vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
		int vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
		return operation(vl, vr);
	}
	T operator[](int i) {
		return query(i, i + 1);
	}
};

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	//modcalc();

	int n;
	cin >> n;
	vector<int> x(n), d(n), y(n);
	vector<P> p(n);
	rep(i, n) {
		cin >> x[i] >> d[i];
		y[i] = x[i] + d[i];
		p[i].first = x[i];
		p[i].second = y[i];
	}
	sort(all(p));
	rep(i, n) {
		x[i] = p[i].first;
		y[i] = p[i].second;
	}
	p.pb(P(INF, INF));
	vector<int> use(n);
	for (int i = 0; i < n; i++) {
		int g = lower_bound(all(x), y[i]) - x.begin();
		use[i] = g - 1;
	}
	lazysegtree<int> dp(n + 2, 0, [](int a, int b) {return (a + b) % mod; }, [](int a, int b) {return b; });
	dp.change(n, 1);
	for (int i = n - 1; i >= 0; i--) {
		int sum = dp.query(i + 1, n + 1);
		dp.change(i, sum);
		dp.lazychange(i + 1, use[i] + 1, 0);
	}
	int ans = 0;
	rep(i, n + 1) {
		ans += dp[i];
		ans %= mod;
	}
	cout << ans << endl;
}

Measured memory_bytes: 19784