#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;
}
struct nd{int id,x;};
ll dp[MAXN];
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;
    stack<nd>st;
    nd xx;
    xx.id=n+1,xx.x=0x3f3f3f3f;
    st.push(xx);
    per(i,n,1){
        while(a[i].y>=st.top().x)st.pop();
        nd p=st.top();
        //if(i!=n&&a[i].y>a[i+1].x)a[i].y=max(a[i].y,a[i+1].y);
        //int p=upper_bound(b+1,b+n+1,a[i].y)-b;
        dp[i]=(dp[i+1]+dp[p.id])%MOD;
        p.id=i;
        p.x=a[i].x;
        st.push(p);

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