#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

const int mod = 998244353;

template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

using modint = ModInt< mod >;

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

  int sz;
  vector< Monoid > seg;

  const F f;
  const Monoid M1;

  SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while(sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }

  void set(int k, const Monoid &x) {
    seg[k + sz] = x;
  }

  void build() {
    for(int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  void update(int k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while(k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  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 = f(L, seg[a++]);
      if(b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }

  Monoid operator[](const int &k) const {
    return seg[k + sz];
  }
};

  // PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_A"                     

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n;
  cin >> n;
  vector<pair<ll,ll>>  rob(n);
  vector<ll> x(n);
  rep(i,n){
    cin >> rob[i].first >> rob[i].second;
    x[i] = rob[i].first;
  }
  sort(x.begin(),x.end());
  sort(rob.begin(),rob.end());
  rob.pb({((ll) 1e18), 0});
  SegmentTree< ll > seg(n+1, [](ll a, ll b) { return max(a, b); }, -1);
  //  vector<ll> nxt(n+1);
  //  nxt[n] = n;
  seg.update(n,n);
  for(int i= n-1; i>=0; i--){
    ll cpos = rob[i].first + rob[i].second;
    ll npos = rob[i+1].first;
    if(cpos > npos){
      // lower_bound seg max
      //upper_bound(x.beign(),x.end(), cpos-1);//cpos未満最大のidx lb
      ll lb = 0;
      ll ub = n;
      while(ub-lb>1){
	ll mid = (ub+lb)/2;
	if(x[mid] < cpos) lb = mid;
	else ub = mid;
      }
      seg.update(i, seg.query(i,lb+1));
      //      nxt[i] = nxt[i+1];
      
    }
    else seg.update(i,i+1);
  }

  
  /*  rep(i,n){
    ll st = i;
    ll cpos = rob[i].first;
    cpos+=rob[i].second;
    ll npos = rob[i+1].first;
    while(npos < cpos){
      cpos = max(cpos, rob[i+1].first+rob[i+1].second);
      i++;
      if(i>n) break;
      npos = rob[i+1].first;
    }
    if(st==i) nxt[st] = i+1;
    else{
      while(st<i){
	nxt[st] = i+1;
	st++;
      }
      i--;
    }
  }*/
  //  cout << "nxt " << endl;
  //  rep(i,n) cout << seg[i] << endl;
  //  cout << "dp " << endl;
  vector<modint> dp(n+1,((modint)0) );
  dp[0] = 1;
  rep(i,n){
    dp[i+1] += dp[i];
    dp[seg[i]] += dp[i];
    //    cout << dp[i] << endl;
  }
  cout << dp[n] << endl;
  
  return 0;
    

}


Measured memory_bytes: 11848