#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;

using lli = long long int;
void YESNO(bool), YesNo(bool);
template <class T1, class T2>
bool chmin(T1 &l, const T2 &r);
template <class T1, class T2>
bool chmax(T1 &l, const T2 &r);
const int MF = 100005, MOD = 998244353;
template <signed M, unsigned T>
struct mod_int
{
  constexpr static signed MODULO = M;
  constexpr static unsigned TABLE_SIZE = T;

  signed x;

  mod_int() : x(0) {}

  mod_int(long long y)
      : x(static_cast<signed>(y >= 0 ? y % MODULO : MODULO - (-y) % MODULO)) {}

  mod_int(int y) : x(y >= 0 ? y % MODULO : MODULO - (-y) % MODULO) {}

  mod_int &operator+=(const mod_int &rhs)
  {
    if ((x += rhs.x) >= MODULO)
      x -= MODULO;
    return *this;
  }

  mod_int &operator-=(const mod_int &rhs)
  {
    if ((x += MODULO - rhs.x) >= MODULO)
      x -= MODULO;
    return *this;
  }

  mod_int &operator*=(const mod_int &rhs)
  {
    x = static_cast<signed>(1LL * x * rhs.x % MODULO);
    return *this;
  }

  mod_int &operator/=(const mod_int &rhs)
  {
    x = static_cast<signed>((1LL * x * rhs.inv().x) % MODULO);
    return *this;
  }

  mod_int operator-() const { return mod_int(-x); }

  mod_int operator+(const mod_int &rhs) const { return mod_int(*this) += rhs; }

  mod_int operator-(const mod_int &rhs) const { return mod_int(*this) -= rhs; }

  mod_int operator*(const mod_int &rhs) const { return mod_int(*this) *= rhs; }

  mod_int operator/(const mod_int &rhs) const { return mod_int(*this) /= rhs; }

  bool operator<(const mod_int &rhs) const { return x < rhs.x; }

  mod_int inv() const
  {
    assert(x != 0);
    if (x <= static_cast<signed>(TABLE_SIZE))
    {
      if (_inv[1].x == 0)
        prepare();
      return _inv[x];
    }
    else
    {
      signed a = x, b = MODULO, u = 1, v = 0, t;
      while (b)
      {
        t = a / b;
        a -= t * b;
        std::swap(a, b);
        u -= t * v;
        std::swap(u, v);
      }
      return mod_int(u);
    }
  }

  mod_int pow(long long t) const
  {
    assert(!(x == 0 && t == 0));
    mod_int e = *this, res = mod_int(1);
    for (; t; e *= e, t >>= 1)
      if (t & 1)
        res *= e;
    return res;
  }

  mod_int fact()
  {
    if (_fact[0].x == 0)
      prepare();
    return _fact[x];
  }

  mod_int inv_fact()
  {
    if (_fact[0].x == 0)
      prepare();
    return _inv_fact[x];
  }

  mod_int choose(mod_int y)
  {
    assert(y.x <= x);
    return this->fact() * y.inv_fact() * mod_int(x - y.x).inv_fact();
  }

  static mod_int _inv[TABLE_SIZE + 1];

  static mod_int _fact[TABLE_SIZE + 1];

  static mod_int _inv_fact[TABLE_SIZE + 1];

  static void prepare()
  {
    _inv[1] = 1;
    for (int i = 2; i <= (int)TABLE_SIZE; ++i)
    {
      _inv[i] = 1LL * _inv[MODULO % i].x * (MODULO - MODULO / i) % MODULO;
    }
    _fact[0] = 1;
    for (unsigned i = 1; i <= TABLE_SIZE; ++i)
    {
      _fact[i] = _fact[i - 1] * int(i);
    }
    _inv_fact[TABLE_SIZE] = _fact[TABLE_SIZE].inv();
    for (int i = (int)TABLE_SIZE - 1; i >= 0; --i)
    {
      _inv_fact[i] = _inv_fact[i + 1] * (i + 1);
    }
  }
};

template <int M, unsigned F>
std::ostream &operator<<(std::ostream &os, const mod_int<M, F> &rhs)
{
  return os << rhs.x;
}

template <int M, unsigned F>
std::istream &operator>>(std::istream &is, mod_int<M, F> &rhs)
{
  long long s;
  is >> s;
  rhs = mod_int<M, F>(s);
  return is;
}

template <int M, unsigned F>
mod_int<M, F> mod_int<M, F>::_inv[TABLE_SIZE + 1];

template <int M, unsigned F>
mod_int<M, F> mod_int<M, F>::_fact[TABLE_SIZE + 1];

template <int M, unsigned F>
mod_int<M, F> mod_int<M, F>::_inv_fact[TABLE_SIZE + 1];

template <int M, unsigned F>
bool operator==(const mod_int<M, F> &lhs, const mod_int<M, F> &rhs)
{
  return lhs.x == rhs.x;
}

template <int M, unsigned F>
bool operator!=(const mod_int<M, F> &lhs, const mod_int<M, F> &rhs)
{
  return !(lhs == rhs);
}

using mint = mod_int<MOD, MF>;
mint binom(int n, int r)
{
  return (r < 0 || r > n || n < 0) ? 0 : mint(n).choose(r);
}

mint fact(int n) { return mint(n).fact(); }

mint inv_fact(int n) { return mint(n).inv_fact(); }

struct ufind
{
  struct node
  {
    int par, rank, size;
    void init(int i)
    {
      par = i;
      rank = 0;
      size = 1;
    }
  };
  vector<node> nodes;
  ufind(int n)
  {
    nodes.resize(n);
    rep(i, n) nodes[i].init(i);
  }
  int find(int x)
  {
    return nodes[x].par == x ? x : (nodes[x].par = find(nodes[x].par));
  }
  void unite(int x, int y)
  {
    x = find(x);
    y = find(y);
    if (x == y)
      return;
    if (nodes[x].rank < nodes[y].rank)
    {
      nodes[x].par = y;
      nodes[y].size += nodes[x].size;
    }
    else
    {
      nodes[y].par = x;
      if (nodes[x].rank == nodes[y].rank)
        nodes[x].rank++;
      nodes[x].size += nodes[y].size;
    }
  }
  bool same(int x, int y) { return find(x) == find(y); }
  int size(int x) { return nodes[find(x)].size; }
};
template <class T>
class segtree
{
public:
  lli n;
  vector<T> dat;
  function<T(T, T)> func;
  T dummy;
  segtree<T>(lli n, T ini, function<T(T, T)> f, T dummy) : func(f), dummy(dummy), n(n)
  {
    lli _n = 1;
    while (_n < n)
    {
      _n = _n * 2;
    }
    n = _n;
    dat.assign(2 * _n - 1, ini);
  }
  void update(lli k, T a)
  {
    k += n - 1;
    dat[k] = a;
    while (k > 0)
    {
      k = (k - 1) / 2;
      dat[k] = func(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }

  T query(int a, int b)
  {
    return query(a, b, 0, 0, n);
  }
  // [a,b)の何かを求める.
  T query(int a, int b, int k, int l, int r)
  {
    //交差しないときはダミー
    if (r <= a || b <= l)
      return dummy;
    if (a <= l && r <= b)
      return dat[k];
    else
    {
      T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
      T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
      return func(vl, vr);
    }
  }
  T get(int a)
  {
    return query(a, a + 1, 0, 0, n);
  }
};

vector<vector<int>> e;
bool visited[200005] = {};
pair<mint, mint> dfs(int u, int p)
{
  visited[u] = true;
  mint white = 1;
  mint black = 1;
  for (auto s : e[u])
  {
    if (s != p)
    {
      auto mm = dfs(s, u);
      white *= (mm.first + mm.second);
    }
  }
  return make_pair(white, black);
}
void solve(long long N, std::vector<long long> X, std::vector<long long> D)
{
  vector<pair<lli, lli>> y;
  rep(i, N) y.emplace_back(X[i], D[i]);
  sort(y.begin(), y.end());
  rep(i, N) X[i] = y[i].first, D[i] = y[i].second;
  vector<int> par(N);
  vector<pair<int, int>> Y;
  stack<pair<int, int>> st;
  rep(i, N)
  {
    auto last = lower_bound(X.begin(), X.end(), D[i] + X[i]) - X.begin();
    int pp = -1;
    //cout << i << " " << last << endl;
    while (!st.empty())
    {
      if (st.top().first > i)
      {
        pp = st.top().second;
        break;
      }
      else
      {
        st.pop();
      }
    }
    st.push(make_pair(last, i));

    par[i] = pp;
  }
  e.resize(N);
  rep(i, N)
  {
    if (par[i] != -1)
    {
      e[i].push_back(par[i]);
      e[par[i]].push_back(i);
    }
  }
  mint ans = 1;
  rep(i, N)
  {
    if (!visited[i])
    {
      ans *= (dfs(i, -1).first + 1);
    }
  }
  cout << ans << endl;
}

int main()
{
  long long N;
  scanf("%lld", &N);
  std::vector<long long> X(N);
  std::vector<long long> D(N);
  for (int i = 0; i < N; i++)
  {
    scanf("%lld", &X[i]);
    scanf("%lld", &D[i]);
  }
  solve(N, std::move(X), std::move(D));
  return 0;
}

// -- lib
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }

template <class T1, class T2>
bool chmin(T1 &l, const T2 &r)
{
  return (l > r) ? (l = r, true) : false;
}

template <class T1, class T2>
bool chmax(T1 &l, const T2 &r)
{
  return (l < r) ? (l = r, true) : false;
}


Measured memory_bytes: 34156