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

#define int long long 
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<int,int> 

const int INF=2e9;
const int mod=998244353;


int32_t main(){
    int n;
    cin>>n;
    pii arr[n];
    int dp[n+1];
    for(int i=0;i<n;i++) cin>>arr[i].ff>>arr[i].ss;
    sort(arr,arr+n);
    dp[n]=1;
    stack<pii> s;
    s.push({n,INF});
    for(int i=n-1;i>=0;i--){
        pii mx=s.top();
        while(mx.ss<arr[i].ff+arr[i].ss){
            s.pop();
            mx=s.top();
        }
        //by coming here means now we have reached an index where we can't reach therefore 
        
        s.push({i,arr[i].ff});
        int j=mx.ff;
        dp[i]=(dp[i+1]+dp[j])%mod;

    }
    cout<<dp[0]<<endl;
}