#include<bits/stdc++.h>

#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple

using namespace std;

const ll MOD = 998244353;

ll dp[200010];
pair<ll,ll> a[200010];
vector<pair<int,ll> > stek;
ll INF = 1e12;
bool sortiraj(pair<ll,ll> x1, pair<ll,ll> x2)
{
    return x1.fi < x2.fi;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> a[i].fi >> a[i].se;

    sort(a, a + n, sortiraj);
    dp[n] = 1;
    stek.pb(mp(n, INF));
    for(int i = n - 1; i >= 0; i--)
    {
        int index;
        while(stek[stek.size()-1].se < a[i].fi + a[i].se) stek.pop_back();
        index = stek[stek.size()-1].fi;
        dp[i] = (dp[i+1] + dp[index])%MOD;
        stek.pb(mp(i, a[i].fi));
    }
    cout << dp[0];

    return 0;
}
