#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl '\n'
//#define int long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define BIT(n) (1LL << (n))
#define TOUPPER(s) transform(s.begin(), s.end(), s.begin(), ::toupper)
#define TOLOWER(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define FILLZERO(s, n)                      \
    do {                                    \
        ostringstream os;                   \
        os << setw(n) << setfill('0') << s; \
        s = os.str();                       \
    } while (0);
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
#define INIT                               \
    std::cin.tie(nullptr);                 \
    std::ios_base::sync_with_stdio(false); \
    cout << std::fixed << std::setprecision(10);

using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pi = pair<int, int>;
template <typename T>
using Pq = priority_queue<T>;
template <typename T>
using pQ = priority_queue<T, vector<T>, greater<T>>;

template <typename T>
vector<T> make_vec(size_t a, T n) { return vector<T>(a, n); }
template <typename T, typename... Ts>
auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); }
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

constexpr ll MOD = 998244353;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename Monoid>
class SegmentTree {
public:
    using F = function<Monoid(Monoid, Monoid)>;

    vector<int> node;
    int size;
    int n;
    F f;
    Monoid ie;

    SegmentTree(vector<int> &in, F f, Monoid ie) : f(f), ie(ie) {
        int in_sz = in.size();
        n = 1;
        while (n < in_sz) {
            n *= 2;
        }
        size = n * 2 - 1;
        node.resize(size, ie);
        for (int i = 0; i < in_sz; i++) {
            node[n - 1 + i] = in[i];
        }
        init_dfs(0);
    }

    int init_dfs(int now) {
        if (2 * now + 1 >= size)
            return node[now];
        node[now] = f(init_dfs(2 * now + 1), init_dfs(2 * now + 2));
        return node[now];
    }

    void add(int index, int val) {
        index += n - 1;
        node[index] += val;
        while (index > 0) {
            index = (index - 1) / 2;
            node[index] = f(node[2 * index + 1], node[2 * index + 2]);
        }
    }

    void update(int index, int val) {
        index += n - 1;
        node[index] = val;
        while (index > 0) {
            index = (index - 1) / 2;
            node[index] = f(node[2 * index + 1], node[2 * index + 2]);
        }
    }

    //半開区間[l,r)に注意
    int query(int a, int b) {
        return _query(a, b, 0, 0, n);
    }

    void debug() {
#ifdef LOCAL
        for (int i = size / 2; i < size / 2 + n; i++) {
            cout << node[i] << (i == size / 2 + n - 1 ? "" : " ");
        }
        cout << endl;
#endif
    }

private:
    int _query(int a, int b, int now, int l, int r) {
        if (r <= a || b <= l)
            return ie;
        if (a <= l && r <= b)
            return node[now];
        int val_l = _query(a, b, 2 * now + 1, l, (l + r) / 2);
        int val_r = _query(a, b, 2 * now + 2, (l + r) / 2, r);
        return f(val_l, val_r);
    }
};

class Fp {
private:
    long long val;

public:
    static long long mod;

    Fp() { val = 0; }
    Fp(long long v) : val(v % mod) {
        if (val < 0)
            val += mod;
    }
    Fp getVal() { return val; }
    Fp operator+=(const Fp &in) {
        val += in.val;
        if (val >= mod)
            val -= mod;
        return *this;
    }
    Fp operator+(const Fp &in) const {
        return Fp(*this) += in;
    }
    Fp &operator-=(const Fp &in) {
        val -= in.val;
        if (val < 0)
            val += mod;
        return *this;
    }
    Fp operator-(const Fp &in) const {
        return Fp(*this) -= in;
    }
    Fp &operator*=(const Fp &in) {
        val = val * in.val % mod;
        return *this;
    }
    Fp operator*(const Fp &in) const {
        return Fp(*this) *= in;
    }
    friend Fp operator*(const long long n, const Fp &in) {
        return in * n;
    }
    Fp &operator/=(const Fp &in) {
        *this *= in.modpow(mod - 2);
        return *this;
    }
    Fp operator/(const Fp &in) const {
        return Fp(*this) /= in;
    }
    bool operator==(const Fp &in) const {
        return val == in.val;
    }
    bool operator!=(const Fp &in) const {
        return val != in.val;
    }
    Fp modpow(long long n) const {
        if (n == 0)
            return 1;
        if (n & 1) {
            return (*this) * ((*this) * (*this)).modpow(n / 2);
        } else {
            return ((*this) * (*this)).modpow(n / 2);
        }
    }
    friend istream &operator>>(istream &is, Fp &fp) {
        is >> fp.val;
        return is;
    }
    friend ostream &operator<<(ostream &os, Fp &fp) {
        os << fp.val;
        return os;
    }
    friend ostream &operator<<(ostream &os, Fp &&fp) {
        os << fp.val;
        return os;
    }
};

Fp modpow(const Fp &in, const long long n) {
    return in.modpow(n);
}
Fp modpow(const ll a, const long long n) {
    return Fp(a).modpow(n);
}

using mint = Fp;
long long mint::mod = MOD;

class Factorial {
public:
    vector<mint> fact, finv;
    Factorial(long long n) : fact(n + 1, mint(1)), finv(n + 1, mint(1)) {
        for (int i = 2; i <= n; i++) {
            mint tmp(i);
            fact[i] = fact[i - 1] * tmp;
            finv[i] = finv[i - 1] / tmp;
        }
    }
    mint perm(const long long n, const long long k) {
        return fact[n] * finv[n - k];
    }
    mint com(const long long n, const long long k) {
        if (n < k || n < 0 || k < 0)
            return mint(0);
        return fact[n] * finv[k] * finv[n - k];
    }
};

signed main() {
    INIT;
    cin >> N;
    vector<pi> xd(N);
    REP(i, N)
    cin >> xd[i].first >> xd[i].second;
    sort(ALL(xd));
    vector<int> x(N), d(N);
    REP(i, N) {
        x[i] = xd[i].first;
        d[i] = xd[i].second + x[i];
    }
    SegmentTree<int> st(
        d, [&](int l, int r) -> int { return max(l, r); }, -INF);
    dump(xd);
    RREP(i, N) {
        int ind = lower_bound(ALL(x), d[i]) - x.begin();
        d[i] = st.query(i, ind);
        st.update(i, d[i]);
    }
    vector<mint> dp(N + 1);
    dp[N] = 1;
    dump(d);
    RREP(i, N) {
        int ind = lower_bound(ALL(x), d[i]) - x.begin();
        dump(ind);
        dp[i] = dp[i + 1] + dp[ind];
    }
    dump(N, dp);
    cout << dp[0] << endl;
}

Measured memory_bytes: 10008