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

#define ll long long
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
const int MAXN = 2e5+5;
const int MOD= 998244353;
int n,b[MAXN];
struct node{
    int x,y;
}a[MAXN];
bool cmp(node a,node b){
    return a.x<b.x;
}
ll dp[MAXN];
stack<int>st;
int main()
{
    scanf("%d",&n);
    rep(i,1,n){
        scanf("%d%d",&a[i].x,&a[i].y);
        a[i].y+=a[i].x-1;
    }
    sort(a+1,a+n+1,cmp);
    rep(i,1,n)b[i]=a[i].x;
    dp[n+1]=1;
    while(!st.empty())st.pop();
    per(i,n,1){
        int y=a[i].y;
        while(!st.empty()&&y>=a[st.top()].x){
            y=max(y,a[st.top()].y);
            st.pop();
        }
        a[i].y=y;
        if(st.empty())dp[i]=(dp[i+1]+dp[n+1])%MOD;
        else dp[i]=(dp[i+1]+dp[st.top()])%MOD;
        st.push(i);

    }
    printf("%lld\n",dp[1]);
}
