#include <bits/stdc++.h>

using namespace std;

template <long long Mod> struct ModInt { /* {{{ */
  long long v;
  constexpr ModInt(const long long x = 0) {
    v = x % Mod;
    if (v < 0) {
      v += Mod;
    }
  }
  constexpr ModInt operator+(const ModInt rhs) const { return ModInt(*this) += rhs; }
  constexpr ModInt operator-(const ModInt rhs) const { return ModInt(*this) -= rhs; }
  constexpr ModInt operator*(const ModInt rhs) const { return ModInt(*this) *= rhs; }
  constexpr ModInt operator/(const ModInt rhs) const { return ModInt(*this) /= rhs; }
  const ModInt &operator+=(const ModInt rhs) {
    v += rhs.v;
    if (v >= Mod) {
      v -= Mod;
    }
    return *this;
  }
  constexpr ModInt &operator-=(const ModInt rhs) {
    if (v < rhs.v) {
      v += Mod;
    }
    v -= rhs.v;
    return *this;
  }
  constexpr ModInt &operator*=(const ModInt rhs) {
    v = v * rhs.v % Mod;
    return *this;
  }
  constexpr ModInt &operator/=(ModInt rhs) {
    long long exp = Mod - 2;
    while (exp) {
      if (exp & 1) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp >>= 1;
    }
    return *this;
  }
  friend ostream &operator<<(ostream &s, ModInt<Mod> m) {
    s << m.v;
    return s;
  }
  friend istream &operator>>(istream &s, ModInt<Mod> m) {
    s >> m.v;
    return s;
  }
}; /* }}} */

template <typename T> struct SegTree { /* {{{ */
  using F = function<T(T, T)>;

  int n;
  vector<T> node;
  const F f;
  const T init_val;

  SegTree(int size, const T init_val, const F f) : SegTree(size, vector<T>(), init_val, f) {}
  SegTree(const vector<T> &v, const T init_val, const F f) : SegTree(v.size(), v, init_val, f) {}
  SegTree(int size, const vector<T> &v, const T init_val, const F f) : init_val(init_val), f(f) {
    n = 1;
    while (n < size) n *= 2;
    node.assign(n * 2, init_val);
    if (!v.empty()) {
      for (int i = 0; i < v.size(); i++) {
        node[i + n] = v[i];
      }
      for (int i = n * 2 - 1; i >= 0; i--) {
        node[i] = f(node[i * 2], node[i * 2 + 1]);
      }
    }
  }
  void update(int idx, T v) {
    node[idx + n] = v;
    for (int i = (idx + n) / 2; i >= 1; i /= 2) {
      node[i] = f(node[i * 2], node[i * 2 + 1]);
    }
  }
  T search(int a, int b, int k = 1, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (r <= a or b <= l) return init_val;
    if (a <= l and r <= b) return node[k];
    auto vl = search(a, b, k * 2, l, (l + r) / 2);
    auto vr = search(a, b, k * 2 + 1, (l + r) / 2, r);
    return f(vl, vr);
  }
}; /* }}} */

const int mod = 998244353;
using modint = ModInt<mod>;

int main() {
  int N;
  cin >> N;
  vector<pair<long long, long long>> robots(N);
  for (int i = 0; i < N; i++) {
    long long x, d;
    cin >> x >> d;
    robots[i] = {x, d};
  }
  sort(robots.begin(), robots.end());

  SegTree<int> st(N, 0, [](int a, int b) { return max(a, b); });
  for (int i = N - 1; i >= 0; i--) {
    auto x = robots[i].first + robots[i].second;
    int r = lower_bound(robots.begin(), robots.end(), make_pair(x, 0LL)) - robots.begin();
    r = max(r, st.search(i, r));
    st.update(i, r);
  }
  vector<vector<modint>> dp(N + 5, vector<modint>(2)); // [active, inactive]
  dp[N][1] = dp[N - 1][0] = dp[N - 1][1] = 1;
  for (int i = N - 2; i >= 0; i--) {
    int r = st.search(i, i + 1);
    dp[i][0] = dp[r][0] + dp[r][1];
    dp[i][1] = dp[i + 1][0] + dp[i + 1][1];
  }
  modint ans = dp[0][0] + dp[0][1];
  cout << ans << endl;

  return 0;
}
/* vim:set fdm=marker: */


Measured memory_bytes: 16384