#include <bits/stdc++.h>
using namespace std;

// 0-indexed
template <class T>
struct SegmentTree {
  // a,b,c: T, e:T(unit)
  // abc = (ab)c = a(bc)
  // ae = ea = a
  typedef function<T(T, T)> F;
  int n;
  F f;
  T unit;
  vector<T> dat;
  SegmentTree(){};
  SegmentTree(int newn, F f, T t) : f(f), unit(t) {
    init(newn);
  }
  SegmentTree(const vector<T> &v, F f, T t)
      : f(f), unit(t) {
    int _n = v.size();
    init(v.size());
    for(int i = 0; i < _n; ++i) dat[n + i] = v[i];
    for(int i = n - 1; i; --i)
      dat[i] = f(dat[i << 1], dat[(i << 1) | 1]);
  }
  void init(int newn) {
    n = 1;
    while(n < newn) n <<= 1;
    dat.assign(n << 1, unit);
  }

  // "go up" process
  void update(int k, T newdata) {
    dat[k += n] = newdata;
    while(k >>= 1) {
      dat[k] = f(dat[(k << 1) | 0], dat[(k << 1) | 1]);
    }
  }
  // [a,b)
  T query(int a, int b) {
    T vl = unit, vr = unit;
    for(int l = a + n, r = b + n; l < r; l >>= 1, r >>= 1) {
      if(l & 1) vl = f(vl, dat[l++]);
      if(r & 1) vr = f(dat[--r], vr);
    }
    return f(vl, vr);
  }
};

template <int mod = (int)998244353>
struct ModInt {
  int x;
  constexpr ModInt() : x(0) {}
  constexpr ModInt(int64_t y)
      : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  constexpr ModInt &operator+=(const ModInt &p) noexcept {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }
  constexpr ModInt &operator-=(const ModInt &p) noexcept {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  constexpr ModInt &operator*=(const ModInt &p) noexcept {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }
  constexpr ModInt &operator/=(const ModInt &p) noexcept {
    *this *= p.inverse();
    return *this;
  }
  constexpr ModInt operator-() const { return ModInt(-x); }
  constexpr ModInt operator+(const ModInt &p) const
      noexcept {
    return ModInt(*this) += p;
  }
  constexpr ModInt operator-(const ModInt &p) const
      noexcept {
    return ModInt(*this) -= p;
  }
  constexpr ModInt operator*(const ModInt &p) const
      noexcept {
    return ModInt(*this) *= p;
  }
  constexpr ModInt operator/(const ModInt &p) const
      noexcept {
    return ModInt(*this) /= p;
  }
  constexpr bool operator==(const ModInt &p) const
      noexcept {
    return x == p.x;
  }
  constexpr bool operator!=(const ModInt &p) const
      noexcept {
    return x != p.x;
  }
  constexpr ModInt inverse() const noexcept {
    int a = x, b = mod, u = 1, v = 0, t = 0;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  constexpr ModInt pow(int64_t n) const {
    ModInt res(1), mul(x);
    while(n) {
      if(n & 1) res *= mul;
      mul *= mul;
      n >>= 1;
    }
    return res;
  }
  friend constexpr ostream &operator<<(
      ostream &os, const ModInt &p) noexcept {
    return os << p.x;
  }
  friend constexpr istream &operator>>(istream &is,
                                       ModInt &a) noexcept {
    int64_t t = 0;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }
  constexpr int get_mod() { return mod; }
};

struct data {
  long long x, d;
  bool operator<(const data &r) { return x < r.x; }
};

long long n;
vector<data> v;
vector<long long> x, memo;
SegmentTree<pair<long long, long long>> seg;
vector<ModInt<>> dp;

ModInt<> solve();

int main() {
  cin >> n;
  v.resize(n);
  x.resize(n);
  for(int i = 0; i < n; ++i) {
    cin >> v[i].x >> v[i].d;
    x[i] = v[i].x;
  }
  sort(x.begin(), x.end());
  sort(v.begin(), v.end());
  cout << solve() << endl;
  return 0;
}

ModInt<> solve() {
  auto fun = [](pair<long long, long long> l,
                pair<long long, long long> r) {
    if(l.first + l.second > r.first + r.second)
      return l;
    else
      return r;
  };
  seg = SegmentTree<pair<long long, long long>>(n + 1, fun,
                                                {0, 0});
  for(int i = 0; i <= n; ++i)
    seg.update(i, make_pair(1, i));
  for(int i = n - 1; i >= 0; --i) {
    long long lim = v[i].x + v[i].d;
    auto it = lower_bound(x.begin(), x.end(), lim);
    int id = it - x.begin();
    pair<long long, long long> now = seg.query(i, id);
    seg.update(i, make_pair(max(now.first + now.second - i,
                                (long long)id - i),
                            i));
  }
  dp.assign(n + 1, 0);
  dp[n] = 1;
  for(int i = n - 1; i >= 0; --i) {
    // not use
    dp[i] = dp[i + 1];
    // use
    dp[i] += dp[i + seg.query(i, i + 1).first];
  }
  return dp[0];
}

Measured memory_bytes: 13952