#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
constexpr long long int MOD = 998244353;
constexpr long double EPS = 1e-12;

//int N, M, K, H, W, L, R;
int N, M, K, H, W, L, R;

long long int power(long long int x, long long int n, long long int M) {
	long long int ret = 1;
	long long int by = x;
	while (n) {
		if (n & 1) {
			ret *= by;
			ret %= M;
		}
		by *= by;
		by %= M;
		n >>= 1;
	}
	return ret;
}

class Segment_Tree {
	vector<long long int>v;
	int num;
	long long int ret;
	bool is_min;
	long long int Update(int place) {
		if (place >= v.size() / 2) {
			return v[place];
		}
		if (is_min) {
			v[place] = min(Update(place * 2), Update(place * 2 + 1));
			return v[place];
		}
		v[place] = max(Update(place * 2), Update(place * 2 + 1));
		return v[place];
	}
public:
	Segment_Tree(int n, bool min) {
		n++;
		num = 1;
		while (num < n * 2) {
			num *= 2;
		}
		is_min = min;
		if (min) {
			v.resize(num, MOD*MOD);
		}
		else v.resize(num, -MOD * MOD);
	}
	void Insert(int place, long long int num, bool update) {
		place += v.size() / 2;
		v[place] = num;
		if (!update)return;
		place /= 2;
		while (place) {
			if (is_min)v[place] = min(v[place * 2], v[place * 2 + 1]);
			else v[place] = max(v[place * 2], v[place * 2 + 1]);
			place /= 2;
		}
	}
	void TopDown() {
		Update(1);
	}
	long long int RMQ(int a, int b) {
		if (is_min)ret = LLONG_MAX;
		else ret = LLONG_MIN;
		if (is_min) {
			b++;
			for (a += num / 2, b += num / 2; a < b; a >>= 1, b >>= 1) {
				if (a & 1)ret = min(ret, v[a++]);
				if (b & 1)ret = min(ret, v[--b]);
			}
		}
		else {
			b++;
			for (a += num / 2, b += num / 2; a < b; a >>= 1, b >>= 1) {
				if (a & 1)ret = max(ret, v[a++]);
				if (b & 1)ret = max(ret, v[--b]);
			}
		}
		return ret;
	}
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	vector<pair<int, int>>v(N);
	for (int i = 0; i < N; i++) {
		cin >> v[i].first >> v[i].second;
	}
	sort(v.begin(), v.end());
	long long int ans = 1;
	vector<int>w(N);
	vector<int>x(N);
	for (int i = 0; i < N; i++)w[i] = v[i].first + v[i].second;
	for (int i = 0; i < N; i++)x[i] = v[i].first;
	for (int i = 1; i < N; i++) {
		w[i] = max(w[i - 1], w[i]);
	}
	int st = 0;
	Segment_Tree sg(N, true);
	vector<long long int>sum(N);
	while (st < N) {
		int ed = st;
		auto it = lower_bound(x.begin(), x.end(), w[ed]) - x.begin();
		while (ed != it - 1) {
			ed = it - 1;
			it = lower_bound(x.begin(), x.end(), w[ed]) - x.begin();
		}
		sg.Insert(ed, 0, true);
		sum[ed] = 1;
		for (int i = ed - 1; i >= st; i--) {
			it = lower_bound(x.begin(), x.end(), v[i].first+v[i].second) - x.begin();
			auto box = sg.RMQ(i, it-1);
			if (box > MOD) {
				box = ed - i;
			}
			if (box == 0) {
				sum[i] = 1;
			}
			else {
				sum[i] = sum[ed - box + 1] + 1;
			}
			sum[i] += sum[i + 1]; 
			sum[i] %= MOD;
			sg.Insert(i, box, true);
		}
		ans *= sum[st]+1;
		st = ed + 1;
		ans %= MOD;
	}
	cout << ans << endl;
}

Measured memory_bytes: 9088