#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:512000000")
#include<utility>
#include<iostream>
#include<fstream>
#include<vector>
#include<array>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<cassert>
#include<ccomplex>

//4Head

#define all(x) x.begin(), x.end()
#define mp make_pair
#define X first
#define Y second

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937_64 gen(time(NULL));

ll const mod = 998244353; //1e9 + 7;

namespace {
	ll mul(ll a, ll b) {
		ll val = a * b - (ll)((ld)a * b / mod) * mod;
		if (val < 0) val += mod;
		if (val >= mod) val -= mod;
		return val;
	}

	ll poww(ll a, ll b) {
		ll val = 1;
		a %= mod;
		while (b > 0) {
			if (b % 2) val = mul(a, val);
			a = mul(a, a);
			b >>= 1;
		}
		return val % mod;
	}

	ll inv(ll a) {
		return poww(a, mod - 2);
	}
}

int const maxn = 3e5 + 5;
struct segtree {
	// 4Head
	struct node {
		node(ll x) : val_mx(x) {};
		node() : val_mx(LLONG_MIN) {}; // neutral
		ll val_mx = LLONG_MIN; // neutral
		ll lazy = -1; // -1
		void apply(int tl, int tr, ll add) {
			val_mx = add; // = add
			lazy = add; // = add
		}
	};
	void push(int u, int tl, int tr) {
		if (t[u].lazy != -1 /*-1*/) {
			int tm = (tl + tr) / 2;
			t[u * 2].apply(tl, tm, t[u].lazy);
			t[u * 2 + 1].apply(tm + 1, tr, t[u].lazy);
			t[u].lazy = -1; //-1
		}
	}
	node merge(const node& a, const node& b) const {
		return node(max(a.val_mx, b.val_mx));
	}
	// 4Head
	node get(int u, int tl, int tr, int l, int r) {
		if (r < l || tl > r || tr < l) {
			return neutral;
		}
		if (l <= tl && tr <= r) {
			return t[u];
		} else {
			push(u, tl, tr);
			int tm = (tl + tr) / 2;
			return merge(get(u * 2, tl, tm, l, r), get(u * 2 + 1, tm + 1, tr, l, r));
		}
	}
	template<typename... M>
	void upd(int u, int tl, int tr, int l, int r, const M&... m) {
		if (r < l || tl > r || tr < l) {
			return;
		}
		if (l <= tl && tr <= r) {
			t[u].apply(tl, tr, m...);
		} else {
			push(u, tl, tr);
			int tm = (tl + tr) / 2;
			upd(u * 2, tl, tm, l, r, m...);
			upd(u * 2 + 1, tm + 1, tr, l, r, m...);
			t[u] = merge(t[u * 2], t[u * 2 + 1]);
		}
	}
	template<class T>
	void build(int u, int tl, int tr, vector<T>& v) {
		if (tl == tr) {
			node tmp(v[tl]);
			t[u] = tmp;
		} else {
			int tm = (tl + tr) / 2;
			build(u * 2, tl, tm, v);
			build(u * 2 + 1, tm + 1, tr, v);
			t[u] = merge(t[u * 2], t[u * 2 + 1]);
		}
	}
	void casual_build(int u, int tl, int tr) {
		if (tl == tr) {
			return;
		} else {
			int tm = (tl + tr) / 2;
			casual_build(u * 2, tl, tm);
			casual_build(u * 2 + 1, tm + 1, tr);
			t[u] = merge(t[u * 2], t[u * 2 + 1]);
		}
	}
	segtree(ll n) : n(n) {
		t.resize(4 * n);
		casual_build(1, 0, n - 1);
	}
	template<class T>
	segtree(vector<T>& v) : n(v.size()) {
		t.resize(4 * n);
		build(1, 0, n - 1, v);
	}
	node get(int l, int r) {
		return get(1, 0, n - 1, l, r);
	}
	template<typename... M>
	void upd(int l, int r, const M&... m) {
		upd(1, 0, n - 1, l, r, m...);
	}
	int n;
	vector<node>t;
	node neutral;
};

ll dp[maxn], nxt[maxn];

signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	vector<pair<ll, ll>> kek(n);
	for (int i = 0; i < n; i++) {
		cin >> kek[i].X >> kek[i].Y;
	}
	sort(all(kek));

	segtree st(n);
	st.upd(n - 1, n - 1, n);
	nxt[n - 1] = n;
	for (int i = n - 2; i >= 0; i--) {
		if (kek[i + 1].X < kek[i].X + kek[i].Y) {
			ll pos = upper_bound(all(kek), mp(kek[i].X + kek[i].Y - 1, LLONG_MAX)) - begin(kek);
			if (pos == n) {
				nxt[i] = n;
			} else {
				nxt[i] = max(pos, st.get(i + 1, pos - 1).val_mx);
			}
		} else {
			nxt[i] = i + 1;
		}
		st.upd(i, i, nxt[i]);
	}
	dp[0] = 1;
	for (int i = 0; i < n; i++) {
		(dp[i + 1] += dp[i]) %= mod;
		(dp[nxt[i]] += dp[i]) %= mod;
	}

	cout << dp[n] << endl;

	return 0;
}

/*
5
2 6 15 5 10

4
2 6 15 5


*/

Measured memory_bytes: 19456