#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef pair<ll,ll> PLL;
typedef pair<char,int> PCI;
typedef pair<int,char> PIC;
typedef pair<ll,int> PLI;
typedef pair<int,ll> PIL; 
typedef pair<ll,char> PLC; 
typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

template<int MOD> struct Fp {
    ll val;
    constexpr Fp(ll v = 0) noexcept : val(v % MOD) {
        if (val < 0) v += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr istream& operator >> (istream &is, Fp<MOD>& x) noexcept {
        return is >> x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};


const int MOD = 998244353;
//const int MOD = 1e6 + 3;
//const int MOD = 1e9 + 7;
const int N_MAX = 2e6+10;
//mint:mod演算のための型
using mint = Fp<MOD>;
//型変換
#define MINT (mint)

//mod MOD上での階乗
mint fact[N_MAX];
mint finv[N_MAX];
void init(){
  fact[0] = fact[1] = MINT 1;
  for(int i = 2; i < N_MAX; i++){
    fact[i] = fact[i-1] * i;
  }
  finv[N_MAX-1] = MINT 1/fact[N_MAX-1];
  for(int i = N_MAX-1; i>0; --i){
    finv[i-1] = finv[i] * i;
  }
}

//mod MOD上での逆元
inline mint inv(mint n){
  return MINT 1/n;
}

//二項係数の計算(mod MOD上)
inline mint COM(int n, int k){
  if(n<k) return 0;
  if(k<0) return 0;
  return fact[n]*finv[k]*finv[n-k];
}

//順列計算
inline mint PER(int n, int k){
  if(n<k) return 0;
  if(k<0) return 0;
  return fact[n]*finv[n-k];
}

template< typename Monoid >
struct SegmentTree{
  using F = function< Monoid(Monoid, Monoid) >;
  
  int sz;
  vector< Monoid > seg;

  const F _operation;
  const F _update;
  const Monoid M1;

  //SegmentTree(n,f,M1):サイズnの初期化，fは2つの苦汗の要素をマージする二項演算，M1はモノイドの単位元
  SegmentTree(int n, const F _operation, const F _update, const Monoid &M1) : _operation(_operation), _update(_update), M1(M1){
    sz = 1;
    while(sz < n) sz<<=1;
    seg.assign(2*sz,M1);
  }

  //set(k,x):k番目の要素にxを代入
  void set(int k, const Monoid &x){
    seg[k+sz] = x;

  }
  
  //build():segTreeの構築
  void build(){
    for(int k = sz-1; k>0; --k){
      seg[k] = _operation(seg[2*k+0], seg[2*k+1]);
    }
  }

  //update(k,x):k番目の要素をxに変更
  void update(int k, const Monoid &x){
    k += sz;
    seg[k] = _update(seg[k],x);
    while(k>>=1) seg[k] = _operation(seg[2*k+0],seg[2*k+1]);
  }

  //区間[a,b)のMonoidを計算
  Monoid query(int a, int b){
    Monoid L = M1, R = M1;
    for(a += sz, b+=sz; a < b; a>>=1, b>>=1){
      if(a&1) L = _operation(L,seg[a++]);
      if(b&1) R = _operation(seg[--b],R);
    }
    return _operation(L,R);
  }

  //operator[k]:k番目の要素を返す
  Monoid operator[](const int &k) const{
    return seg[k+sz];
  }

};

int main(void){
  SPEEDUP
  cout << setprecision(15);
  init();
  int N;cin >> N;
  vector<PLL> in(N);
  rep(i,N)cin >> in[i].first >> in[i].second;
  sort(all(in));
  map<int,int> mp;
  rep(i,N){
    in[i].second += in[i].first;
    mp[in[i].first] = 0;
    mp[in[i].second] = 0;
  }
  int M = 0;
  for(auto p : mp)mp[p.first] = M++;

  SegmentTree< int > maxseg(M,
      [](int a, int b) { return max(a,b); },
      [](int a, int b) { return b; },
      0);

  rep(i,N) maxseg.set(mp[in[i].first],i+1);
  maxseg.build();

  vector<mint> dp(N+1,0);
  dp[N] = 1;
  per(i,N){
    int ni = maxseg.query(mp[in[i].first],mp[in[i].second]);
    maxseg.update(mp[in[i].first],ni);
    dp[i] = dp[i+1] + dp[ni];
  }
  cout << dp[0] << endl;
  return 0;
} 



Measured memory_bytes: 59008