#include <bits/stdc++.h>
using namespace std;

long long mod = 998244353;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;

    vector<pair<long long, long long>> a(n + 1);
    for (int i = 0; i < n; i++){
        cin >> a[i].first >> a[i].second;
        a[i].second += a[i].first;
    }

    a[n].first = a[n].second = 1e18;

    sort(a.begin(), a.end());

    vector<long long> dp(n + 1);
    dp[n] = 1;
    stack<int> st;
    st.push(n);
    for (int i = n - 1; i >= 0; i--){
        while (a[i].second > a[st.top()].first)
            st.pop();

        int j = st.top();
        st.push(i);
        dp[i] = (dp[i + 1] + dp[j]) % mod;

    }

    cout << dp[0] << '\n';

    return 0;
}
