#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#define vll vector<ll>
#define vvv vector<vvl>
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvvl(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
typedef __int128_t lll;
using namespace std;

ll P = 998244353;
vvl G = vv(300000, 0, 0, ll);

vll use(300000, 0);
vll top(300000, 0);


struct LazySegmentTree {
private:
    int n;
    ll INF = -1;
    vector<int> node, lazy;
    vector<bool> lazyFlag;
public:
    LazySegmentTree(vector<int> v) {
        int sz = (int)v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, INF);
        lazyFlag.resize(2*n-1, false);
        for(int i=0; i<sz; i++) node[i+n-1] = v[i];
        for(int i=n-2; i>=0; i--) node[i] = max(node[i*2+1], node[i*2+2]);
    }

    void lazyEvaluate(int k, int l, int r) {
        if(lazyFlag[k]) {
            node[k] = lazy[k];
            if(r - l > 1) {
                lazy[k*2+1] = lazy[k*2+2] = lazy[k];
                lazyFlag[k*2+1] = lazyFlag[k*2+2] = true;
            }
            lazyFlag[k] = false;
        }
    }

    void update(int a, int b, int x, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] = x;
            lazyFlag[k] = true;
            lazyEvaluate(k, l, r);
        }
        else {
            update(a, b, x, 2*k+1, l, (l+r)/2);
            update(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = max(node[2*k+1], node[2*k+2]);
        }
    }

    int find(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return INF;
        if(a <= l && r <= b) return node[k];
        int vl = find(a, b, 2*k+1, l, (l+r)/2);
        int vr = find(a, b, 2*k+2, (l+r)/2, r);
        return max(vl, vr);
    }
};

ll dfs(ll now, ll from){
  if(use[now]==1) return 1;
  use[now] = 1;
  ll ret = 1, cnt = 0;
  for(int i=0;i<G[now].size();i++){
    if(G[now][i]==from) continue;
    cnt++;
  }
  if(cnt==0) return top[now] = 2;
  for(int i=0;i<G[now].size();i++){
    if(G[now][i]==from) continue;
    ret = (ret * dfs(G[now][i], now))%P;
  }
  ret = (ret + 1)%P;
  return top[now] = ret;
}
int main(int argc, char const *argv[]) {
  ll n;std::cin >> n;
  vvl d = vv(n, 2, 0, ll);
  re(i, n) scanf("%lld %lld", &d[i][0], &d[i][1]);
  sort(all(d));

  map<ll, ll> mp;

  re(i, n){
    mp.emplace(d[i][0]-1, 0);
    mp.emplace(d[i][0], 0);
    mp.emplace(d[i][0]+1, 0);

    mp.emplace(d[i][0]+d[i][1]-2, 0);
    mp.emplace(d[i][0]+d[i][1]-1, 0);
    mp.emplace(d[i][0]+d[i][1], 0);
  }

  ll c = 0;
  for(auto itr=mp.begin();itr!=mp.end();itr++, c++) (*itr).second = c;

  LazySegmentTree seg(vector<int>(mp.size()+1, -1));

  re(i, n){
    ll q = seg.find(mp.at(d[i][0]), mp.size()+1);
    //std::cout << i << " pat " << q << '\n';
    if(q!=-1){
      G[q].push_back(i);
      G[i].push_back(q);
    }
    seg.update(mp.at(d[i][0]), mp.at(d[i][0]+d[i][1]), i);
  }

  ll ans = 1;
  for(int i=0;i<n;i++) {
    if(use[i]==1) continue;
    ans = (ans * dfs(i, -1))%P;
  }
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 146744