#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 <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }

constexpr ll mod = 998244353;

template<class T>
class lazysegtree {
	int n;
	vector<T> data, lazy;
	vector<bool> lazyflag;
	T id = 0;
	T operation(T a, T b) { return (a + b) % mod; };
public:
	lazysegtree(size_t _n){
		n = 1;
		while (n < _n) { n <<= 1; }
		data = lazy = vector<T>(2 * n - 1, id);
		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] = x;
		while (i > 0) {
			i = (i - 1) / 2;
			data[i] = operation(data[i * 2 + 1], data[i * 2 + 2]);
		}
	}
	T get(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 id;
		if (a <= l && r <= b) return data[k];
		int vl = get(a, b, 2 * k + 1, l, (l + r) / 2);
		int vr = get(a, b, 2 * k + 2, (l + r) / 2, r);
		return operation(vl, vr);
	}
	T operator[](int i) { return get(i, i + 1); }
};

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
 
	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);
	dp.change(n, 1);
	for (int i = n - 1; i >= 0; i--) {
		int sum = dp.get(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: 13560