#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include <list>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}
struct Node{
    using Type = int;
    Type val;
    static const Type id = numeric_limits<Type>::min();
    Node(Type v = id):val(v){}
    friend Node merge(const Node &a, const Node &b){
        return Node(max(a.val, b.val));
    }
};
template<class Node>
struct SegmentTree{
    int n;
    vector<Node> seg;
    using T = typename Node::Type;
    SegmentTree(const vector<Node>&d){
        n = 1;
        while(d.size() > n)n *= 2;
        seg.resize(2 * n - 1, Node::id);
        for(int i = 0; i < d.size(); i++){
            seg[i + n - 1] = d[i];
        }
        for(int i = n - 2; i >= 0; i--){
            seg[i] = merge(seg[2 * i + 1], seg[2 * i + 2]);
        }
    }
    SegmentTree(int sz){
        n = 1;
        while(n < sz)n *= 2;
        seg.resize(2 * n - 1, Node::id);
    }
    void update(int x, T k){
        x += n - 1;
        seg[x] = Node(k);
        while(x){
            x = (x - 1) / 2;
            seg[x] = merge(seg[2 * x + 1], seg[2 * x + 2]);
        }
    }
    void update(int x, Node k){
        x += n - 1;
        seg[x] = k;
        while(x){
            x = (x - 1) / 2;
            seg[x] = merge(seg[2 * x + 1], seg[2 * x + 2]);
        }
    }
    Node query(const int a, const int b, int k = 0, int l = 0, int r = -1){
        if(r < 0)r = n;
        if(r <= a or b <= l){
            return Node();
        }
        if(a <= l and r <= b){
            return seg[k];
        }else{
            return merge(query(a, b, 2 * k + 1, l, (l + r) / 2), query(a, b, 2 * k + 2, (l + r) / 2, r));
        }
    }
};
const ll mod = 998244353;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<pii> a(n);
    rep(i,n){
        int x, d;
        cin >> x >> d;
        a[i] = pii(x, d);
    }
    sort(a.begin(), a.end());
    show(a);
    vector<int> nxt(n);
    SegmentTree<Node> seg(n);
    for(int i = n - 1; i >= 0; i--){
        nxt[i] = i;
        int k = a[i].first + a[i].second;
        int id = (int)(lower_bound(a.begin(), a.end(),pii(k , -1)) - a.begin());
        //        if(id == n)continue;
        nxt[i] = max(nxt[i],seg.query(i,id).val);
        seg.update(i, nxt[i]);
    }
    show(nxt);
    vector<ll> dp(n+1);
    dp[n] = 1;
    for(int i = n - 1; i >= 0; i--){
        dp[i] += dp[nxt[i] + 1];
        dp[i] += dp[i+1];
        dp[i] %= mod;
        show(dp);
    }
    show(dp);
    cout<< dp[0] << endl;
    
}


Measured memory_bytes: 6272