#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(),c.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ll long long
#define ull unsigned long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace std; 

const double PI = 3.1415926536;
int days[13] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

template<typename T>
ostream& operator <<(ostream& out, const vector<T>& mas) {
    for (const auto& x : mas) {
        out << x << ' ';
    }
    return out;
}

void ok() {
    cout << "YES" << '\n';
}

void no() {
    cout << "NO" << '\n';
}

inline ll nxt() {
    ll x;
    cin >> x;
    return x;
}

class SegmTree{
public:

    SegmTree(int n)
        : tree(4 * n)
        , n(n)
    {
    }

    void upd(int v, int l, int r, int indx, int value) {
        if (indx < l || indx > r) {
            return;
        }
        if (l == r) {
            tree[v] = value;
            return;
        }

        int md = (l + r) / 2;
        upd(v * 2, l, md, indx, value);
        upd(v * 2 + 1, md + 1, r, indx, value);
        tree[v] = max(tree[v * 2], tree[v * 2 + 1]);
    }

    int get(int v, int l, int r, int tl, int tr) {
        if (l > tr || tl > r) {
            return INT_MIN;
        } 
        if (tl <= l && r <= tr) {
            return tree[v];
        }

        int md = (l + r) / 2;
        int t1 = get(v * 2, l, md, tl, tr);
        int t2 = get(v * 2 + 1, md + 1, r, tl, tr);
        return max(t1, t2);
    }

    void upd(int indx, int value) {
        upd(1, 0, n - 1, indx, value);
    }

    int get(int l, int r) {
        return get(1, 0, n - 1, l, r);
    }

private:
    int n;
    vector<int> tree;
};


template <int mod>
struct Modular {
    int val;
 
    Modular(long long _val = 0) {
        if (_val < 0 || _val >= mod) {
            val = _val % mod;
            if (val < 0) {
                val += mod;
            }
        } else {
            val = _val;
        }
    }
 
    Modular operator +(const Modular& ot) const {
        int res = val + ot.val;
        if (res >= mod) {
            res -= mod;
        }
        return {res};
    }
 
    Modular operator -(const Modular& ot) const {
        int res = val - ot.val;
        if (res < 0) {
            res += mod;
        }
        return {res};
    }
 
    Modular operator *(const Modular& ot) const {
        return {1ll * val * ot.val};
    }
 
    Modular& operator ++() {
        val += 1;
        if (val == mod) {
            val = 0;
        }
        return *this;
    }
 
    Modular operator ++(int) {
        Modular tmp(*this);
        operator ++();
        return tmp;
    }
 
    void operator +=(const Modular& ot) {
        val += ot.val;
        if (val >= mod) {
            val -= mod;
        }
    }
 
    void operator -=(const Modular& ot) {
        val -= ot.val;
        if (val < 0) {
            val += mod;
        }
    }
 
    void operator *=(const Modular& ot) {
        val = 1ll * val * ot.val % mod;
    }
 
    bool operator ==(const Modular& ot) const {
        return val == ot.val;
    }
 
    bool operator !=(const Modular& ot) const {
        return val != ot.val;
    }
};

template <int mod>
ostream& operator <<(ostream& ostr, const Modular<mod>& x) {
    return ostr << x.val;
} 
const int mod = 998244353;
using Mint = Modular<mod>;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int n = nxt();
    vector<pii> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i].first >> a[i].second;
        a[i].second += a[i].first;
    }
    sort(all(a));

    SegmTree tree(n);
    vector<int> mx(n);
    for (int i = n - 1; i >= 0; i--) {
        int l = i, r = n;
        while (r - l > 1) {
            int md = (r + l) / 2;
            if (a[md].first < a[i].second) {
                l = md;
            } else {
                r = md;
            }
        } 

        mx[i] = max(tree.get(i, l), i);
        tree.upd(i, mx[i]);
    }

    vector<Mint> dp(n + 1);
    dp[0] = 1;
    for (int i = 0; i < n; i++) {
        dp[i + 1] += dp[i];
        dp[mx[i] + 1] += dp[i];
    }
    cout << dp[n];
    return 0;
}


Measured memory_bytes: 6528