#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <deque>

using namespace std;

#define LL long long

const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};

LL mod(LL x, LL md) {
	return ((x % md) + md) % md;
}

class Mint {
public:
	static LL md;
	LL x;
	Mint(LL _x = 1) {
		x = mod(_x, md);
	}
	Mint(const Mint &y) {
		x = mod(y.x, md);
	}
};

void MintMyExgcd(LL a, LL b, LL &x, LL &y) {
	// solve equation ax + by = 1 (mod m)
	LL md = Mint::md;
	if (b == 0) {
		y = 0;
		x = 1;
		return ;
	}
	MintMyExgcd(b, a % b, x, y);
	LL t = y;
	y = mod(x - (a / b) * y, md);
	x = t;
}

LL MintNY(LL x) {
	if (x == 0) {
		return 1;
	}
	LL md = Mint::md;
	LL a, b;
	MintMyExgcd(x, md, a, b);
	while (a < 0) {
		a += md;
	}
	return a;
}

/* LL gcd(LL a, LL b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
} */

Mint operator+(Mint a, Mint b) {
	return Mint(mod(a.x + b.x, Mint::md));
}
Mint operator-(Mint a, Mint b) {
	return Mint(mod(a.x - b.x, Mint::md));
}
Mint operator*(Mint a, Mint b) {
	return Mint(mod(a.x * b.x, Mint::md));
}
Mint operator/(Mint a, Mint b) {
	Mint c = Mint(MintNY(b.x));
	return Mint(mod(a.x * c.x, Mint::md));
}

Mint operator-(Mint a) {
	return Mint(-a.x);
}
bool operator==(Mint a, Mint b) {
	return a.x == b.x;
}
bool operator!=(Mint a, Mint b) {
	return a.x != b.x;
}
bool operator>(Mint a, Mint b) {
	return a.x > b.x;
}
bool operator<(Mint a, Mint b) {
	return a.x < b.x;
}
bool operator>=(Mint a, Mint b) {
	return a.x >= b.x;
}
bool operator<=(Mint a, Mint b) {
	return a.x <= b.x;
}

void operator+=(Mint &a, Mint b) {
	a = a + b;
}
void operator-=(Mint &a, Mint b) {
	a = a - b;
}
void operator*=(Mint &a, Mint b) {
	a = a * b;
}
void operator/=(Mint &a, Mint b) {
	a = a / b;
}

ostream& operator<<(ostream &out, Mint a) {
	out << a.x;
	return out;
}

istream& operator>>(istream &in, Mint &a) {
	in >> a.x;
	return in;
}

Mint factorial(LL n) {
	if (n == 0) {
		return Mint(1);
	}
	Mint res = 1;
	for (LL i = 1; i <= n; ++i) {
		res *= i;
	}
	return res;
}
Mint multiRange(LL s, LL t) {
	Mint res = 1;
	for (LL i = s; i <= t; ++i) {
		res *= i;
	}
	return res;
}

Mint getC(LL n, LL k) {
	if (n - k < k) {
		return getC(n, n - k);
	}
	return multiRange(n - k + 1, n) / factorial(k);
}

Mint getA(LL n, LL k) {
	return multiRange(n - k + 1, n);
}

Mint countNonNegativeDivision(LL n, LL k) {
	return getC(n + k - 1, k - 1);
}
Mint countPositiveDivision(LL n, LL k) {
	if (n < k) {
		return 0;
	}
	if (k <= 0) {
		return 0;
	}
	return getC(n - 1, k - 1);
}
Mint quickMod(Mint a, LL b) {
	Mint res = 1;
	while (b > 0) {
		if (b % 2) {
			res *= a;
		}
		a *= a;
		b /= 2;
	}
	return res;
}

LL Mint::md = 998244353;

class Robot {
public:
	int x, d;
	Robot(int _x, int _d): x(_x), d(_d) {}
};
bool cmp(const Robot &a, const Robot &b) {
	return a.x < b.x;
}
int main() {
	int n;
	int x, d;
	vector<Robot> r;
	// Mint res = 1;

	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf("%d%d", &x, &d);
		r.push_back(Robot(x, d));
	}
	sort(r.begin(), r.end(), cmp);
	int *f = new int[n];
	for (int i = 0; i < n; ++i) {
		f[i] = i;
	}
	/* vector<int> c;
	int ct = 0;
	int cur = 0;
	while (cur < n) {
		int xRight = r[cur].x + r[cur].d;
		++cur;
		int lc = 1;
		while (cur < n && r[cur].x < xRight) {
			xRight = max(xRight, r[cur].x + r[cur].d);
			++lc;
			++cur;
		}
		c.push_back(lc);
	}
	for (int i = 0; i < c.size(); ++i) {
		res *= (c[i] + 1);
	}
	cout << res << endl; */

	/* for (int i = 0; i < n; ++i) {
		bool found = false;
		for (int j = i - 1; j >= 0; --j) {
			if (r[j].x + r[j].d > r[i].x) {
				f[i] = j;
				found = true;
				break;
			}
		}
		if (!found) {
			f[i] = i;
		}
	} */
	deque<int> qi, qx;
	int qn = 0;
	for (int i = 0; i < n; ++i) {
		// cout << "work on " << i << endl;
		int xx = r[i].x;
		while (qn > 0) {
			int idx = qi[0];
			int dd = r[idx].x + r[idx].d;
			if (xx >= dd) {
				qi.pop_front();
				qx.pop_front();
				--qn;
			}
			else {
				break;
			}
		}
		if (qn == 0) {
			qi.push_back(i);
			qx.push_back(r[i].x + r[i].d);
			f[i] = i;
			++qn;
			continue;
		}
		else {
			int idx = qi[0];
			f[i] = idx;

			while (qn > 0) {
				int idx = qi[0];
				int xxx = qx[0];
				if (xxx <= xx + r[i].d) {
					qi.pop_front();
					qx.pop_front();
					--qn;
				}
				else {
					break;
				}
			}
			qi.push_front(i);
			qx.push_front(r[i].x + r[i].d);
			++qn;
		}
	}

	Mint *resi = new Mint[n];
	for (int i = 0; i < n; ++i) {
		resi[i] = 1;
	}
	/* for (int i = 0; i < n; ++i) {
		cout << r[i].x << ' ';
	}
	cout << endl;
	for (int i = 0; i < n; ++i) {
		cout << (r[i].x + r[i].d) << ' ';
	}
	cout << endl; */
	Mint res = 1;
	for (int i = n - 1; i >= 0; --i) {
		// printf("f[%d] = %d\n", i, f[i]);
		resi[i] += 1;
		if (f[i] != i) {
			resi[f[i]] *= resi[i];
		}
		else {
			res *= resi[i];
		}
	}
	cout << res << endl;

	return 0;
}

Measured memory_bytes: 4208