/* ****revpro**** */
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define endl     '\n'
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell         998244353
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)    
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define mii      map<ll,ll>
using namespace std;

#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define N  500005
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;  
#define ordered_set tree<double, null_type,less<double>, rb_tree_tag,tree_order_statistics_cur_update> 
vi a(N),seg(4*N),lazy(4*N);
ll add(ll x,ll y,ll mod=hell) { x += y; if(x >= mod) x -= mod; return x;}
ll sub(ll x,ll y,ll mod=hell) { x -= y; if(x < 0) x += mod; return x;}
ll mul(ll x,ll y,ll mod=hell) { return (x * 1ll * y) % mod;}
void updaterange(ll cur,ll st,ll end,ll l,ll r,ll val)
{
  if(lazy[cur]!=0)                                    /* 2-change */
  {
    seg[cur]=0;          /* 3-change */
    if(st!=end)
    {
      lazy[cur<<1]=1;            /* 4-change */
      lazy[(cur<<1)+1]=1;                   /* 5-change */
    }
    lazy[cur]=0;                                    /* 6-change */
  }
  if(st>end||st>r||end<l) return;
  if(l<=st&&end<=r)
  {
    seg[cur]=0;              /* 7-change */
    if(st!=end)
    {
      lazy[(cur<<1)]=1;                           /* 8-change */
      lazy[(cur<<1)+1]=1;                         /* 9-change */
    }
    return;
  }
  ll mid=(st+end)>>1;
  updaterange((cur<<1),st,mid,l,r,val);
  updaterange((cur<<1)+1,mid+1,end,l,r,val);
  seg[cur]=add(seg[cur<<1],seg[(cur<<1)+1]);                  /* 10-change */
}
ll query(ll cur,ll st,ll end,ll l,ll r)
{
  if(st>end||st>r||end<l) return 0;
  if(lazy[cur]!=0)
  {
    seg[cur]=0;                /* 11-change */
    if(st!=end)
    {
      lazy[(cur<<1)]=1;                    /* 12-change */
      lazy[(cur<<1)+1]=1;                  /* 13-change */
    }
    lazy[cur]=0;
  }

  if(st>=l&&end<=r) return seg[cur];
  ll mid=(st+end)>>1;
  ll ans1=query(cur<<1,st,mid,l,r);
  ll ans2=query((cur<<1)+1,mid+1,end,l,r);
  return add(ans1,ans2);                                 /* 14-change */
}
void update(ll cur,ll start,ll end,ll idx,ll val)
{

  // cout<<cur<<' '<<start<<' '<<end<<endl;
  if(lazy[cur]!=0)                                    /* 2-change */
  {
    seg[cur]=0;          /* 3-change */
    if(start!=end)
    {
      lazy[cur<<1]=1;            /* 4-change */
      lazy[(cur<<1)+1]=1;                   /* 5-change */
    }
    lazy[cur]=0;                                    /* 6-change */
  }
  if(start>end||start>idx||end<idx) return;
  if((start == end)&&(idx==start))
    {
      seg[cur] = add(val,seg[cur]);
      return ;
    }
  ll mid = (start + end) >> 1;
  update((cur<<1), start, mid, idx, val);
  update((cur<<1)+1, mid+1, end, idx, val);
  seg[cur] = add(seg[cur<<1] , seg[(cur<<1)+1]);
}
void solve()
{
  ll n;
  cin>>n;
  pii x[n];
  set <ll> s;
  s.insert(-1e9-7);
  map <ll,ll> idx;
  ll cnt=0;
  rep(i,0,n) cin>>x[i].F>>x[i].S,s.insert(x[i].F+x[i].S-1),s.insert(x[i].F);
  for(auto i:s) idx[i]=cnt++;
    // cout<<cnt<<endl;
  sort(x,x+n);
  update(1,0,cnt-1,0,1);
  rep(i,0,n)
  {
    update(1,0,cnt-1,idx[x[i].F+x[i].S-1],query(1,0,cnt-1,0,idx[x[i].F+x[i].S-1]-1));
    updaterange(1,0,cnt-1,idx[x[i].F],idx[x[i].F+x[i].S-1]-1,0);
  }
  cout<<query(1,0,cnt-1,0,cnt-1);

}
signed main()
{
  
    /***********************************/
    unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
    mt19937_64 generator (seed);
    /***********************************/

  // ios_base::sync_with_stdio(false);
  // cin.tie(0);
  // cout.tie(0);
  int TESTS=1;
//  cin>>TESTS;
  while(TESTS--)
  {
    solve();
    
  }
  TIME
  return 0;
}

Measured memory_bytes: 82304