#include<bits/stdc++.h>

using namespace std;


class ModInt{
private:
  long long number;

public:
  static constexpr long long mod = 998244353;

  constexpr ModInt(const ModInt& x) : number(x.number){};

  constexpr ModInt(const long long number = 0) : number((mod + number) % mod){}

  constexpr long long get() const{
    return number;
  }

  constexpr ModInt& operator=(const ModInt& rhs) &{
    number = rhs.number;
    return *this;
  }

  constexpr ModInt operator+() const{
    return ModInt(*this);
  }

  constexpr ModInt operator-() const{
    return ModInt(mod - number);
  }

  constexpr ModInt& operator+=(const ModInt& rhs){
    number += rhs.number;
    if(number >= mod) number -= mod;
    return *this;
  }

  constexpr ModInt& operator-=(const ModInt& rhs){
    number -= rhs.number;
    if(number < 0) number += mod;
    return *this;
  }

  constexpr ModInt& operator*=(const ModInt& rhs){
    (number *= rhs.number) %= mod;
    return *this;
  }

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

  constexpr ModInt inverse() const{
    long long a = number, m = mod, u = 1, v = 0;

    while(m){
      long long t = a / m;
      a -= t * m;
      u -= t * v;

      //swap a, m
      a ^= m;
      m ^= a;
      a ^= m;

      //swap u, v
      u ^= v;
      v ^= u;
      u ^= v;
    }

    return ModInt(u);
  }

  constexpr ModInt& operator++(){
    return *this += 1;
  }

  constexpr ModInt& operator--(){
    return *this -= 1;
  }

  constexpr ModInt operator++(int){
    ModInt ret = *this;
    ++(*this);
    return ret;
  }

  constexpr ModInt operator--(int){
    ModInt ret = *this;
    --(*this);
    return ret;
  }
};

constexpr ModInt operator+(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs) += rhs;
}

constexpr ModInt operator-(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs) -= rhs;
}

constexpr ModInt operator*(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs) *= rhs;
}

constexpr ModInt operator/(const ModInt& lhs, const ModInt&rhs){
  return ModInt(lhs) /= rhs;
}

constexpr ModInt operator^(const ModInt& lhs, const int& rhs){
  long long b = lhs.get(), e = rhs, y = 1, mod = lhs.mod;
  bool inv = e < 0;
  if(inv) e = -e;

  while(e){
    if(e & 1) (y *= b) %= mod;

    (b *= b) %= mod;
    e >>= 1;
  }

  return (inv ? ModInt(y).inverse() : ModInt(y));
}

std::istream& operator>>(std::istream& is, ModInt& x){
  long long in;
  is >> in;
  x = in;
  return is;
}

std::ostream& operator<<(std::ostream& os, const ModInt& x){
  os << x.get();
  return os;
}


template<class M, class F = std::function<M(M, M)>>
class SegmentTree{
private:
  std::vector<M> data;
  F op;
  M e;
  int length;

public:
  SegmentTree(int n, const F op, const M& e) : op(op), e(e){
    length = 1;
    while(length < n) length <<= 1;
    data = std::vector<M>((length << 1) - 1, e);
  }

  void update(int index, const M& x){
    index += length - 1;
    data[index] = x;

    while(index){
      (--index) >>= 1;
      data[index] = op(data[(index << 1) + 1], data[(index << 1) + 2]);
    }
  }

  M query(int left, int right){
    M l = e, r = e;

    for(left += length - 1, right += length - 1; left < right; (--left) >>= 1, (--right) >>= 1){
      if((left ^ 1) & 1) l = op(data[left++], l);
      if((right ^ 1) & 1) r = op(data[--right], r);
    }

    return op(l, r);
  }
};


int main(){
  int N;
  cin >> N;
  
  vector<pair<int, int>> robot(N);
  for(int i = 0; i < N; i++){
    cin >> robot[i].first >> robot[i].second;
  }
  sort(robot.begin(), robot.end());
  
  SegmentTree<int> right(N + 1, [](int a, int b){
    return max(a, b);
  }, 0);
  
  for(int i = 0; i <= N; i++){
    right.update(i, i);
  }
  
  vector<ModInt> dp(N + 1);
  dp[N] = 1;
  
  for(int i = N - 1; i >= 0; i--){
    auto itr = lower_bound(robot.begin(), robot.end(), make_pair(robot[i].first + robot[i].second, 0));
    int j = itr - robot.begin();
    int r = right.query(i, j);
    right.update(i, r);
    
    dp[i] = dp[i + 1] + dp[r + 1];
  }
  
  cout << dp[0] << endl;
  
  return 0;
}

Measured memory_bytes: 5376