#include <bits/stdc++.h>
using namespace std;
const auto start_time = std::chrono::high_resolution_clock::now();
void timecalculater(){
    #ifndef ONLINE_JUDGE
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
    #endif
}
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a,v) memset(a, v, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
ll p=998244353;
const int N=2e6+5;
int t[N];
ll n;
void update(int ind,int val){
    ind+=n;
    t[ind]=val;
    ind=ind/2;
    while(ind>1){
        t[ind]=max(t[ind*2],t[2*ind+1]);
        ind=ind/2;
    }
}
int query(int l,int r){
    l+=n;r+=n;
    int ans=0;
    while(l<=r){
        if(l%2==1){
            ans=max(ans,t[l]);
            l++;
        }
        if(r%2==0){
            ans=max(ans,t[r]);
            r--;
        }
        l=l/2;r=r/2;
    }
    return ans;
}
int main() {
  
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
    int T=1;
    // cin>>T;
    while(T--){
        cin>>n;
        pll a[n+1];
        rep(i,n)cin>>a[i].fst>>a[i].snd;
        sort(a,a+n);
        a[n]={2e10,0};
        ll dp[n+1]={0};
        dp[n-1]=2;
        dp[n]=1;
        ll suf[n];
        suf[n-1]=n-1;
        ll x[n+1],d[n+1];
        update(n-1,n-1);
        rep(i,n+1){
            x[i]=a[i].fst;
            d[i]=a[i].snd;
            d[i]--;
        }
        for(int i=n-2;i>=0;i--){
            if((x[i]+d[i])<(x[i+1])){
                suf[i]=i;   
                update(i,i);
            }
            else{
                suf[i]=suf[i+1];
                ll ind=upper_bound(x,x+n+1,x[i]+d[i])-x;
                ind--;
                // dbg(ind);
                suf[i]=query(i+1,ind);
                update(i,suf[i]);
            }
            dp[i]=(dp[i+1]+dp[suf[i]+1])%p;
            // dbg(suf[i],dp[i]);
        }
        cout<<dp[0];
    }   
    timecalculater();
    return 0;   
} 
// 13
// -998188800 794568589
// -775030134 776346252
// -375829244 88414122
// -281850709 297272382
// -199098404 492186576
// 1193893 459756822
// 136177766 174852037
// 285580934 447594573
// 394100521 590786707
// 71454109 660771303
// 72163337 355849990
// 731258914 3102125
// 737089720 225648406






Measured memory_bytes: 11264