#include <bits/stdc++.h>

#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int MOD = 998244353;
const int maxn = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;

PII p[maxn];

int main() {
    stack<PII> s;
    int n, res = 1;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d%d", &p[i].fi, &p[i].se);
    sort(p + 1, p + 1 + n, [](PII &x, PII &y) {
        return x.fi > y.fi;
    });
    s.push({inf, res});
    for (int i = 1, r; i <= n; i++) {
        r = p[i].fi + p[i].se;
        while (r > s.top().fi) s.pop();
        res = (res + s.top().se) % MOD;
        s.push({p[i].fi, res});
    }
    printf("%d\n", res);
	return 0;
}
