#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
const int inf = 1 << 30;
const ll linf = 1e18;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

template<long long mod>
struct modint{
    long long num;

    constexpr modint(long long x = 0) : num((x + mod) % mod) {}

    constexpr modint &operator += (const modint& rhs){
        num = (num + rhs.num) % mod;
        return *this;
    }
    constexpr modint &operator -= (const modint& rhs){
        num  -= rhs.num;
        while(num < 0) num += mod;
        num %= mod;
        return *this;
    }
    constexpr modint &operator *= (const modint& rhs){
        num = num * rhs.num % mod;
        return *this;
    }
    constexpr modint &operator /= (modint rhs){
        int exp = mod - 2;
        while(exp > 0){
            if(exp % 2){
                *this *= rhs;
            }
            rhs *= rhs;
            exp /= 2;
        }
        return *this;
    }

    constexpr modint operator ++ (){
        ++num;
        return *this;
    }

    constexpr modint operator ++ (int n){
        modint tmp = *this;
        ++(*this);
        return tmp;
    }

    constexpr modint operator -- (){
        --num;
        return *this;
    }
    constexpr modint operator -- (int n){
        const modint tmp = *this;
        --(*this);
        return tmp;
    }

    constexpr modint operator + (const modint& rhs) const {
        return modint(*this) += rhs;
    }
    constexpr modint operator - (const modint& rhs) const {
        return modint(*this) -= rhs;
    }
    constexpr modint operator * (const modint& rhs) const {
        return modint(*this) *= rhs;
    }
    constexpr modint operator / (const modint& rhs) const {
        return modint(*this) /= rhs;
    }

    
    friend ostream &operator << (ostream& lhs, const modint& rhs){
        return lhs << rhs.num;
    }

    friend istream &operator >> (istream& lhs, modint& rhs){
        long long tmp;
        lhs >> rhs.num;
        return lhs;
    }
};

template<class T>
struct seg_tree{
    T N;
    T init = 0;
    vector<T> node;

    seg_tree(int n){
        N = 1;
        while(N < n) N *= 2;
        node.resize(N * 2 - 1, 0);
    }

    void update(int i, T x){
        i += N - 1;
        node[i] = x;
        while(i > 0){
            i = (i - 1) / 2;
            node[i] = max(node[i * 2 + 1], node[i * 2 + 2]);
        }
    }

    T get_max(int a, int b, int k = 0, int l = 0, int r = -1){
        if(r == -1) r = N;
        if(b <= l || r <= a) return init;
        if(a <= l && r <= b) return node[k];

        T vl = get_max(a, b, k * 2 + 1, l, (l + r) / 2);
        T vr = get_max(a, b, k * 2 + 2, (l + r) / 2, r);
        return max(vl, vr);
    }
};

#define mint modint<998244353>

mint dp[200010];
int to[200010];
int N;
vector<pll> robot; 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> N;
    for(int i = 0; i < N; i++){
        int X, D;
        cin >> X >> D;
        robot.push_back({X, D});
    }

    seg_tree<int> seg(N);
    sort(robot.begin(), robot.end());
    for(int i = N - 1; i >= 0; i--){
        auto range = lower_bound(robot.begin(), robot.end(), pll{robot[i].first + robot[i].second, -linf}) - robot.begin();
        to[i] = seg.get_max(i, range);
        if(to[i] == 0) to[i] = i + 1;
        seg.update(i, to[i]);
    }

    dp[0] = 1;
    for(int i = 0; i < N; i++){
        dp[i + 1] += dp[i];
        dp[to[i]] += dp[i];
    }
    cout << dp[N] << endl;
    return 0;
}

Measured memory_bytes: 8684