#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

template <int64_t MOD>
class Modint {
  using Self = Modint<MOD>;

  int64_t m_value;

 public:
  explicit Modint(int64_t value) : m_value((value % MOD + MOD) % MOD) {}
  Self pow(int64_t e) const {
    if (e == 0) {
      return (Self)1;
    } else if (e % 2 == 0) {
      return ((*this) * (*this)).pow(e / 2);
    } else {
      return (*this).pow(e - 1) * (*this);
    }
  }
  Self inv() const { return pow(MOD - 2); }
  Self& operator=(const Self& rh) {
    m_value = rh.m_value;
    return *this;
  }
  Self operator-() const { return Self(-m_value); }
  Self operator+(const Self& other) const {
    return Self(m_value + other.m_value);
  }
  Self operator-(const Self& other) const {
    return Self(m_value - other.m_value);
  }
  Self operator*(const Self& other) const {
    return Self(m_value * other.m_value);
  }
  Self operator/(const Self& other) const { return (*this) * other.inv(); }
  Self& operator+=(const Self& rh) { return (*this) = (*this) + rh; }
  Self& operator-=(const Self& rh) { return (*this) = (*this) - rh; }
  Self& operator*=(const Self& rh) { return (*this) = (*this) * rh; }
  int64_t value() const { return m_value; }
};

template <typename T>
class SegmentTree {
  const T unit;
  const function<T(const T&, const T&)> op;
  vector<T> container;

 public:
  template <typename Op>
  SegmentTree(int size, const T& identity, const Op& operation)
      : unit(identity), op(operation), container(msb(size * 2 - 1)) {
    fill(container.begin(), container.end(), unit);
  }
  void update(size_t index, T value) {
    int n = container.size() / 2;
    container[index + n] = value;

    int node = (index + n) >> 1;
    while (node > 0) {
      container[node] = op(container[node << 1], container[(node << 1) + 1]);
      node >>= 1;
    }
  }
  T find(size_t s, size_t t) {
    if (s >= t) {
      return unit;
    }
    return find_inner(s, t, 0, container.size() / 2);
  }

 private:
  T find_inner(size_t s, size_t t, size_t lb, size_t ub) {
    if (s == lb && t == ub) {
      int n = container.size() / 2;
      return container[lca(n + s, n + t - 1)];
    }

    T result = unit;
    size_t mid = (lb + ub) / 2;
    if (mid > s) {
      result = op(result, find_inner(s, min(mid, t), lb, mid));
    }
    if (mid < t) {
      result = op(result, find_inner(max(s, mid), t, mid, ub));
    }

    return result;
  }
  int lca(int n0, int n1) {
    int a = n0 ^ n1;
    return n0 / msb(a);
  }
  int msb(int x) {
    x |= x >> 1;
    x |= x >> 2;
    x |= x >> 4;
    x |= x >> 8;
    x |= x >> 16;

    return x + 1;
  }
};

int main() {
  int N;
  cin >> N;

  using P = pair<int, int>;

  vector<P> p;
  rep(i, N) {
    int x, d;
    cin >> x >> d;
    p.push_back(P(x, x + d));
  }
  sort(p.begin(), p.end());

  vector<int> quantile;
  rep(i, N) { quantile.push_back(p[i].first); }

  using Mint = Modint<998244353>;
  SegmentTree<int> y(N, 0,
                     [](const int& lh, const int& rh) { return max(lh, rh); });
  vector<Mint> s(N + 1, (Mint)0), t(N + 1, (Mint)0);
  s[N] = (Mint)1;
  rrep(i, N) {
    int j = lower_bound(quantile.begin(), quantile.end(), p[i].second) -
            quantile.begin();
    int k;
    if (j == i + 1) {
      k = j;
    } else {
      k = y.find(i + 1, j);
    }
    y.update(i, k);
    s[i] = s[k] + t[k];
    t[i] = s[i + 1] + t[i + 1];
  }

  /*rep(i, N) {
    cerr << "\t" << p[i].first << "\t" << p[i].second << "\t"
         << y.find(i, i + 1) << "\t" << s[i].value() << "\t" << t[i].value()
         << "\t";
    for (int j = p[0].first; j < p[i].first; j++) {
      cerr << " ";
    }
    for (int j = p[i].first; j < p[i].second; j++) {
      cerr << "-";
    }
    cerr << "\n";
  }*/
  cout << (s[0] + t[0]).value() << endl;

  return 0;
}

Measured memory_bytes: 8816