"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}
function lower_bound(d,e,a,b){for(var c;1<b-a;)d[c=a+b>>1]<e?a=c:b=c;return d[a]<e?b:a};

function segTree(n){
  var l = n.length, u = l-1, x = 2, i, v;
  while(u)u >>= 1, x <<= 1;
  v = this.seg = Array(x-1).fill(0);
  this.l = x = (x >> 1) - 1;
  for(i = 0; i < l; i++)v[i+x] = n[i];
  for(i = x-1; i >= 0; i--)v[i] = segSolve(v[i+i+1],v[i+1<<1]);
}
function segSolve(a,b){
  return Math.max(a,b);
}
segTree.prototype={
  get:function(l,r){//[l,r)
    if(l >= r)return 0;
    var v = this.seg;
    return q(l,r,0,this.l+1,0);
    function q(l,r,x,y,i){
      if(l === x && r === y)return v[i];
      var m = x+y >> 1;
      if(m < r)if(l < m)return segSolve(q(l,m,x,m,i+i+1),q(m,r,m,y,i+1<<1));
      else return q(l,r,m,y,i+1<<1);
      return q(l,r,x,m,i+i+1);
    }
  },
  update:function(x,i){
    var v = this.seg;
    i += this.l;
    v[i] = x;
    for(i = i-1>>1; i >= 0; i = i-1>>1){
      v[i] = segSolve(v[i+i+1],v[i+1<<1]);
    }
  },
}

var mod = 998244353;

var myOut = main();
if(myOut !== undefined)console.log(myOut);

function main(){
  var n = next();
  var x = Array(n), d = {};
  for(var i = 0; i < n; i++){
    var a = next(), b = next();
    x[i] = a, d[a] = b;
  }
  x.sort((a,b)=>a-b);
  var seg = new segTree(Array(n).fill().map((a,i)=>i));
  var id = Array(n).fill().map((a,i)=>i);
  for(var i = n-1; i--;){
    var u = lower_bound(x,x[i]+d[x[i]],i,x.length);
    if(i === u-1)continue;
    var v = seg.get(i+1,u);
    seg.update(v,i);
    id[i] = v;
  }
  var dp = xArray(0,n+1);
  dp[n] = 1;
  dp[n-1] = 2;
  for(var i = n-1; i--;){
    dp[i] = dp[i+1] + dp[id[i]+1];
    dp[i] %= mod;
  }
  return dp[0] % mod;
}