#line 1 "/mnt/c/Users/leafc/dev/compro/lib/math/modint.hpp"
#include <cstdint>
#include <iostream>
#ifndef MOD_INT
#define MOD_INT

template <std::uint_fast64_t MOD> class ModInt {
  using u64 = std::uint_fast64_t;

public:
  ModInt(const u64 val = 0) { value = val % MOD; }

  ModInt operator+(const ModInt rhs) const { return ModInt(*this) += rhs; }
  ModInt operator-(const ModInt rhs) const { return ModInt(*this) -= rhs; }
  ModInt operator*(const ModInt rhs) const { return ModInt(*this) *= rhs; }
  ModInt operator/(const ModInt rhs) const { return ModInt(*this) /= rhs; }

  ModInt &operator+=(const ModInt rhs) {
    value += rhs.value;
    if (value >= MOD) {
      value -= MOD;
    }
    return *this;
  }

  ModInt &operator-=(const ModInt rhs) {
    if (value < rhs.value) {
      value += MOD;
    }
    value -= rhs.value;
    return *this;
  }

  ModInt &operator*=(const ModInt rhs) {
    value = value * rhs.value % MOD;
    return *this;
  }

  ModInt &operator/=(ModInt rhs) {
    *this *= rhs.inv();
    return *this;
  }

  ModInt &operator++(int n) {
    value++;
    if (value >= MOD) {
      value -= MOD;
    }
    return *this;
  }

  ModInt &operator--(int n) {
    if (value == 0) {
      value += MOD;
    }
    value--;
    return *this;
  }

  ModInt inv() { return ModInt::pow(*this, MOD - 2); }

  static ModInt pow(ModInt base, long long int n) {
    ModInt res = ModInt(1);
    while (n) {
      if (n & 1) {
        res *= base;
      }
      base *= base;
      n /= 2;
    }
    return res;
  }

  static ModInt comb(ModInt n, ModInt r) { return comb(n.value, r.value); }

  static ModInt comb(int n, int r) {
    if (n < r)
      return ModInt(0);
    ModInt res = ModInt(1);
    for (int i = 0; i < r; i++) {
      res *= ModInt(n - i);
    }

    ModInt inv = ModInt(1);
    for (int i = 0; i < r; i++) {
      inv *= ModInt(r - i);
    }
    return res / inv;
  }

  u64 getValue() const { return value; }

private:
  u64 value;

  friend std::ostream &operator<<(std::ostream &out, const ModInt<MOD> &m) {
    out << m.value;
    return out;
  }

  friend std::istream &operator>>(std::istream &in, ModInt &m) {
    uint_fast64_t i;
    in >> i;
    m = ModInt(i);
    return in;
  }
};

#endif
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/segment_tree.hpp"
#include <functional>
#include <vector>
#ifndef SEGMENT_TREE
#define SEGMENT_TREE

template <class T> class SegmentTree {
public:
  SegmentTree(const int n, const T id, std::function<T(T, T)> op, std::function<T(T, T)> updateOp)
      : id(id), op(op), updateOp(updateOp) {
    leafNum = 1;
    while (leafNum < n)
      leafNum *= 2;
    data = std::vector<T>(2 * leafNum - 1, id);
  }

  void update(const int index, const T value) {
    int i = leaf(index);
    data[i] = updateOp(data[i], value);
    while (i > 0) {
      i = parent(i);
      data[i] = op(data[rightChildIndex(i)], data[leftChildIndex(i)]);
    }
  }

  T find(const int l, const int r) { return query(l, r, 0, 0, leafNum); }

private:
  int leftChildIndex(const int parent) { return parent * 2 + 1; }

  int rightChildIndex(const int parent) { return parent * 2 + 2; }

  int parent(const int child) { return (child - 1) / 2; }

  int leaf(const int index) { return index + leafNum - 1; }

  T query(const int l, const int r, const int node, const int al, const int ar) {
    if (r <= al || ar <= l)
      return id;
    if (l <= al && ar <= r)
      return data[node];
    int mid = (al + ar) / 2;
    T leftValue = query(l, r, leftChildIndex(node), al, mid);
    T rightValue = query(l, r, rightChildIndex(node), mid, ar);
    return op(leftValue, rightValue);
  }

private:
  std::vector<T> data;
  int leafNum;
  T id;
  std::function<T(T, T)> op;
  std::function<T(T, T)> updateOp;
};
#endif
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
const int INF = 2147483647;
const ll MOD = 1000000007;

using namespace std;


#line 4 "abc158_f.cpp"

using mint = ModInt<998244353>;

int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> xd(n);
  vi x(n);
  REP(i, n) {
    int d;
    cin >> x[i] >> d;
    xd[i] = pair<int, int>(x[i], d);
  }
  sort(ALL(xd));
  sort(ALL(x));

  SegmentTree<int> seg(
      n + 1, 0, [](int a, int b) -> int { return max(a, b); }, [](int a, int b) -> int { return b; });

  seg.update(n, n);
  seg.update(n - 1, n);
  for (int i = n - 1; i >= 0; i--) {
    int j = lower_bound(ALL(x), xd[i].first + xd[i].second) - x.begin();
    int value = max(j, seg.find(i, j));
    seg.update(i, value);
  }

  vector<vector<mint>> dp(n + 1, vector<mint>(2, mint(0)));
  dp[n][0] = mint(1);
  dp[n][1] = mint(0);

  for (int i = n - 1; i >= 0; i--) {
    dp[i][0] = dp[i + 1][0] + dp[i + 1][1];
    dp[i][1] = dp[seg.find(i, i + 1)][0] + dp[seg.find(i, i + 1)][1];
  }

  cout << dp[0][0] + dp[0][1] << endl;
}


Measured memory_bytes: 15616