/**
* Think twice, code once.
* 1.integer overflow(maybe even long long overflow : (a+b >= c) -> (a >= c-b)
* 2.runtime error
* 3.boundary condition
* ---------------------------------------------------------------------------------------
* Author : zzy
* Date : 2020-03-12-20.13.34 Thursday
*/
#include <bits/stdc++.h>

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, a, b) for (int i = (int)(a); i >= (int)b; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define per(i, r, l) for (int i = (r); i >= (l); i--)
#define ms(x, y) memset(x, y, sizeof(x))
#define SZ(x) ((int)(x).size())

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) {
    return a > b ? (a = b, true) : false;
}
template<class T> bool uax(T &a, T b) {
    return a < b ? (a = b, true) : false;
}

const i64 maxn = 2*(i64)1e5 + 1000;
const i64 mod = 998244353;
i64 n, rmost[maxn], dp[maxn], a[maxn], tVal[maxn<<4];
struct node {
    i64 l, d;
} rev[maxn];

int query(int node, int l, int r, int ql, int qr) {
    if (ql > qr) return 0;
    if (l >= ql && r <= qr) return tVal[node];
    int mid = (l+r) >> 1;
    int res = 1;
    if (ql <= mid) res = max(res, query(node<<1, l, mid, ql, qr));
    if (mid < qr) res = max(res, query(node<<1|1, mid+1, r, ql, qr));
    return res;
}
int pushUp(int node) {
    tVal[node] = max(tVal[node<<1], tVal[node<<1|1]);
}
void update(int node, int l, int r, int pos, int val) {
    if (l == r) {
        tVal[node] = val;
        return;
    }
    int mid = (l+r) >> 1;
    if (pos <= mid) update(node<<1, l, mid, pos, val);
    else update(node<<1|1, mid+1, r, pos, val);
    pushUp(node);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "r", stdin);
#endif

    ms(rmost, 0);
    cin >> n;
    for1(i, n) {
        cin >> rev[i].l >> rev[i].d;
    }
    sort(rev+1, rev+1+n, [&](node n1, node n2) {
        return n1.l<n2.l;
    });
    for1(i, n) a[i] = rev[i].l;
    for (int i = n; i >= 1; --i) {
        int idx = lower_bound(a+1+i, a+1+n, a[i]+rev[i].d)-a-1;
  //      if (idx == i) rmost[i] = i;
        rmost[i] = query(1, 1, n, i+1, idx);
        if (!rmost[i]) rmost[i] = i;
        update(1, 1, n, i, rmost[i]);
    }
    ms(dp, 0);
    dp[n+1] = 1;
    for (int i = n; i >= 1; --i) {
        dp[i] = (dp[i+1]+dp[rmost[i]+1])%mod;
        //cerr << i << ' ' << dp[i] << ' ' << rmost[i] << endl;
    }
    cout << dp[1] << endl;

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Measured memory_bytes: 14848