#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

template<class U, class V>
istream& operator >>(istream& in, pair<U, V>& pr) {
    return in >> pr.first >> pr.second;
}

template<class U, class V>
ostream& operator <<(ostream& out, pair<U, V>& p) {
    return out << p.first << " " << p.second;
}

template<class T>
ostream& operator <<(ostream& out, vector<T> vec) {
    for (T& e : vec)
        out << e << " ";
    return out << endl;
}

// ---- BEGIN LIBRARY CODE ----
/**
 * 1-D Segment Tree data structure. Supports element updates and binary
 * associative operations over range like (addition, max, min) in logarithmic
 * time. Space usage is linear in n. Works with numeric data types like
 * 32/64 bit integers and doubles.
 */
template<class T>
class SegmentTree
{
public:
    SegmentTree(int _n, T _initial, const function<T(T, T)> _op)
    {
        n = _n;
        op = _op;
        initial = _initial;
        tree.clear();
        tree.resize(4 * n + 5, initial);
    }

    /** Updates a single element at index x to newval. */
    void update(int x, T newval)
    {
        stack<int> pathToX;
        int i = 0, l = 0, r = n - 1;
        while (l < x || r > x) {
            pathToX.push(i);
            int m = (l + r) / 2;
            if (x > m) {
                l = m + 1;
                i = 2 * i + 2;
            } else {
                r = m;
                i = 2 * i + 1;
            }
        }

        tree[i] = newval;

        // move back upto the root, updating all the nodes in the path.
        while (!pathToX.empty()) {
            int i = pathToX.top();
            pathToX.pop();
            tree[i] = op(tree[2 * i + 1], tree[2 * i + 2]);
        }
    }

    T rangeQuery(int x, int y)
    {
        return rangeQuery(x, y, 0, 0, n - 1);
    }
private:
    /** Returns the result of the operator performed over the entire 
      range specified by [x, y], both ends inclusive. */
    T rangeQuery(int x, int y, int i, int l, int r)
    {
        if (x > y)
            return initial;

        if (x <= l && y >= r)
            return tree[i];

        int m = (l + r) / 2;
        if (y <= m)
            return rangeQuery(x, y, 2 * i + 1, l, m);
        else if (x > m)
            return rangeQuery(x, y, 2 * i + 2, m + 1, r);

        T half1 = rangeQuery(x, m, 2 * i + 1, l, m);
        T half2 = rangeQuery(m + 1, y, 2 * i + 2, m + 1, r);
        return op(half1, half2);
    }

    int n;
    T initial;
    function<T(T, T)> op;
    vector<T> tree;
};
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    auto maxxer = [](int x, int y) {
        return max(x, y);
    };

    int N;
    cin >> N;
    SegmentTree<int> segTree(N, 0, maxxer);
    const int MOD = 998244353;

    VEC(Pii) Robots(N);
    READVEC(Robots);
    sort(ALL(Robots));

    VEC(int) Dp(N + 1, 0);
    Dp[N] = 1;
    FORD(i, N - 1, -1) {
        int x = Robots[i].first, d = Robots[i].second;
        int j = lower_bound(ALL(Robots), Pii(x + d, 0)) - BEGIN(Robots);
        int maxv = max(j, segTree.rangeQuery(i + 1, j - 1));
        segTree.update(i, maxv);
        Dp[i] = Dp[i + 1];
        Dp[i] += Dp[maxv];
        Dp[i] %= MOD;
    }

    cout << Dp[0] << endl;
    return 0;
};

Measured memory_bytes: 5760