#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) { return std::vector<T>(n, std::forward<T>(val)); }
template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}
template<class Cond> struct chain {
  Cond cond; chain(Cond cond) : cond(cond) {}
  template<class T> bool operator()(T& a, const T& b) const { if(cond(a, b)) { a = b; return true; } return false; }
};
template<class Cond> chain<Cond> make_chain(Cond cond) { return chain<Cond>(cond); }

#include <iostream>
using i64 = long long;
template<i64 M> struct modint { i64 a;
  constexpr modint(const i64 x = 0): a((x%M+M)%M){}
  constexpr i64 value() const { return a; }
  constexpr modint inv() const { return this->pow(M-2); }
  constexpr modint pow(i64 r) const {
    modint ans(1); modint aa = *this;
    while(r) { if(r & 1) ans *= aa; aa *= aa; r >>= 1; }
    return ans;
  }
  constexpr modint& operator=(const i64 r) { a = (r % M + M) % M; return *this; }
  constexpr modint& operator+=(const modint r) { a += r.a; if(a >= M) a -= M; return *this; }
  constexpr modint& operator-=(const modint r) { a -= r.a; if(a < 0) a += M; return *this; }
  constexpr modint& operator*=(const modint r) { a = a * r.a % M; return *this; }
  constexpr modint& operator/=(const modint r) { (*this) *= r.inv(); return *this; }
  constexpr modint operator+(const modint r) const { return modint(*this) += r; }
  constexpr modint operator-(const modint r) const { return modint(*this) -= r; }
  constexpr modint operator*(const modint r) const { return modint(*this) *= r; }
  constexpr modint operator/(const modint r) const { return modint(*this) /= r; }
  constexpr bool operator!=(const modint r) const { return this->value() != r.value(); }
};

template<const i64 M> std::ostream& operator<<(std::ostream& os, const modint<M>& m) { os << m.value(); return os; }

#include <vector>
using i64 = long long;

template<class T, class Ope, const T* Ide>
struct segment_tree {
  Ope ope;
 
  i64 n;
  std::vector<T> node;
 
  segment_tree(const std::vector<T>& init) {
    n = 1;
    while(n < init.size()) n *= 2;
    node.resize(2 * n, *Ide);
    for(int i = 0;i < init.size();i++) node[i + n] = init[i];
    for(int i = n - 1; i >= 1;i--) node[i] = ope(node[i * 2], node[i * 2 + 1]);
  }
 
  void update(i64 i, T x) {
    i += n;
    node[i] = x;
    while(i > 1) {
      i = i / 2;
      node[i] = ope(node[i * 2], node[i * 2 + 1]);
    }
  }

  /* [l, r) */
  T sum(i64 l, i64 r) const {
    T lx = *Ide;
    T rx = *Ide;
    l += n;
    r += n;
    while(l < r) {
      if(l & 1) { lx = ope(lx, node[l++]); }
      if(r & 1) { rx = ope(node[--r], rx); }
      l >>= 1;
      r >>= 1;
    }
    return ope(lx, rx);
  }
};

struct max_magma {
  i64 operator()(i64 a, i64 b) const { return std::max(a, b); }
};
const i64 max_ide = 0;

using maxseg = segment_tree<i64, max_magma, &max_ide>;

int main() {
  i64 N;
  cin >> N;
  vector<pair<i64, i64>> vec;
  rep(i,0,N) {
    i64 x, d;
    cin >> x >> d;
    vec.emplace_back(x, d);
  }
  sort(all(vec));
  vector<i64> X(N);
  vector<i64> D(N);
  rep(i,0,N) {
    X[i] = vec[i].first;
    D[i] = vec[i].second;
  }

  using fp = modint<998244353>;

  auto dp = ndvec(N + 1, fp(0));
  auto sum = ndvec(N + 1, fp(0));
  maxseg seg(std::vector<i64>(N + 1, 0));
  seg.update(N, N);
  dp[N] = 1;
  sum[N] = 1;
  for(i64 i = N; i --> 0; ) {
    i64 right = std::lower_bound(all(X), X[i] + D[i]) - std::begin(X);
    i64 rightest = std::max(i + 1, seg.sum(i + 1, right));
    dp[i] = sum[rightest];
    sum[i] = sum[i + 1] + dp[i];
    //cout << i << " = " << dp[i] << " " << sum[i] << " " << rightest << endl;
    seg.update(i, rightest);
  }
  cout << sum[0] << endl;
}


Measured memory_bytes: 16236