#include <bits/stdc++.h>

#define ll long long
#define str string
#define pii pair<int, int>
#define pll pair<ll, ll>
#define fi first
#define se second

#define vc vector<char>
#define vvc vector<vc>
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define vvll vector<vll>
#define vvvll vector<vvll>
#define vs vector<str>
#define vvs vector<vs>
#define vpii vector<pii>
#define vvpii vector<vpii>
#define vpll vector<pll>
#define vvpll vector<vpll>
#define vb vector<bool>
#define vvb vector<vb>
#define rep(i, a, b) for (int i = (a); i < int(b); i++)
#define repi(i, a, b) for (int i = (a); i <= int(b); i++)


using namespace std;
ll INF = LONG_LONG_MAX;
ll mod = 998244353;

template <typename T, typename L>
void read(vector<T> & _data, L & _size, bool _shift) {
    _data.resize(_size + (ll)_shift);
    for (ll i = (ll)_shift; i < _size + (ll)_shift; i++)
        cin >> _data[i];
}

template <typename T, typename L>
void read(vector<vector<T>> & _data, L & _rows, L & _cols, bool _shiftRows, bool _shiftCols) {
    _data.resize(_rows + (ll)_shiftRows);
    for (ll i = 0; i < _rows + (ll)_shiftRows; i++)
        _data[i].resize(_cols + (ll)_shiftCols);
    for (ll i = (ll)_shiftRows; i < _rows + (ll)_shiftRows; i++)
        for (ll j = (ll)_shiftCols; j < _cols + (ll)_shiftCols; j++)
            cin >> _data[i][j];
}

template <typename T>
void write(vector<T> & _data, bool _shift) {
    for (ll i = (ll)_shift; i < _data.size(); i++)
        cout << _data[i] << " ";
    cout << endl;
}


//TODO: SOLUTION

ll n, m;
vll x, d, f;
vll dp;
vll segtree;

void mktree() {
    m = 1;
    while (m < n)
        m *= 2;
    segtree.resize(2 * m, 0);
}

void upd(ll i, ll x) {
    i += m;
    while (i > 0) {
        segtree[i] = max(segtree[i], x);
        i /= 2;
    }
}

ll getmax(ll l, ll r) {
    l += m;
    r += m;
    ll ans = 0;
    while (l <= r) {
        if (l % 2 == 1)
            ans = max(ans, segtree[l++]);
        if (r % 2 == 0)
            ans = max(ans, segtree[r--]);
        l /= 2;
        r /= 2;
    }
    return ans;
}

void solve() {
    cin >> n;
    vpll a(n);
    rep(i, 0, n) {
        cin >> a[i].first >> a[i].second;
    }
    sort(a.begin(), a.end());

    x.resize(n);
    d.resize(n);
    rep(i, 0, n) {
        x[i] = a[i].first;
        d[i] = a[i].second;
    }

    mktree();
    f.resize(n, 0);

    for (ll i = n - 1; i >= 0; i--) {
        ll lo = i;
        ll hi = n - 1;
        ll best = i;
        while (lo <= hi) {
            ll mid = (lo + hi) / 2;
            if (x[mid] < x[i] + d[i]) {
                best = mid;
                lo = mid + 1;
            }
            else {
                hi = mid - 1;
            }
        }
        f[i] = i;
        f[i] = max(f[i], getmax(i, best));
        upd(i, f[i]);
    }

    dp.resize(n + 1, 1);
    for (ll i = n - 1; i >= 0; i--) {
        dp[i] = dp[i + 1] + dp[f[i] + 1];
        dp[i] = dp[i] % mod;
    }
    cout << dp[0] << endl;
}


int main() {

    // TODO: Set value of this variable manually
    bool _multipleTestCases = false;

    if (_multipleTestCases) {
        ll t; cin >> t;
        while (t--)
            solve();
    }
    else {
        solve();
    }

    return 0;
}

Measured memory_bytes: 16644