#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <cassert>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;

constexpr int MOD = 998244353;
struct ModInt {
    ll x;
    ModInt (ll a) : x((a % MOD + MOD) % MOD) {}
    ModInt operator- () const {
        return ModInt(-x);
    }
    ModInt &operator+= (const ModInt &a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    ModInt &operator-= (const ModInt &a) {
        if ((x -= a.x) < 0) x += MOD;
        return *this;
    }
    ModInt &operator*= (const ModInt &a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    ModInt operator+ (const ModInt &a) const {
        ModInt res(*this);
        return res += a;
    }
    ModInt operator- (const ModInt &a) const {
        ModInt res(*this);
        return res -= a;
    }
    ModInt operator* (const ModInt &a) const {
        ModInt res(*this);
        return res *= a;
    }
    ModInt pow(ll t) const {
        if (!t) return 1;
        ModInt a = pow(t / 2);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    ModInt inv() const {
        return pow(MOD - 2);
    }
    ModInt &operator/= (const ModInt &a) {
        return (*this) *= a.inv();
    }
    ModInt operator/ (const ModInt &a) const {
        ModInt res(*this);
        return res /= a;
    }
    friend istream &operator>> (istream &is, ModInt &a) {
        is >> a.x;
        return is;
    }
    friend ostream &operator<< (ostream &os, const ModInt &a){
        os << a.x;
        return os;
    }
};

template <typename Operator>
struct SegmentTree {
    Operator OP;
    using TypeNode = decltype(OP.NodeE);
    int length;
    vector<TypeNode> node;
    SegmentTree (int N) {
        length = 1;
        while (length < N) length <<= 1;
        node.assign(length << 1, OP.NodeE);
    }
    SegmentTree (vector<TypeNode> &vec) {
        length = 1;
        while (length < vec.size()) length <<= 1;
        node.assign(2 * length, OP.NodeE);
        for (int i = 0; i < vec.size(); ++i) node[i + length] = vec[i];
        for (int i = length - 1; i > 0; --i) node[i] = OP.func(node[(i << 1) + 0], node[(i << 1) + 1]);
    }
    void update(int idx, TypeNode val) {
        idx += length;
        node[idx] = OP.change(node[idx], val);
        while (idx >>= 1) node[idx] = OP.func(node[(idx << 1) + 0], node[(idx << 1) + 1]);
    }
    TypeNode get(int l, int r) {
        l += length;
        r += length;
        TypeNode vl = OP.NodeE, vr = OP.NodeE;
        while (r > l) {
            if (l & 1) vl = OP.func(vl, node[l++]);
            if (r & 1) vr = OP.func(node[--r], vr);
            l >>= 1;
            r >>= 1;
        }
        return OP.func(vl, vr);
    }
};

struct hoge {
    int NodeE = 0;
    int func(int x, int y) {return max(x, y);}
    int change(int x, int y) {return y;}
};

int main() {
    int n;
    cin >> n;
    vector<pair<ll, ll>> s(n);
    REP(i, n) cin >> s[i].first >> s[i].second;
    sort(ALL(s));
    s.push_back({INF, 0});
    vector<ModInt> dp(n + 1, ModInt(0));
    SegmentTree<hoge> ST(n);
    dp[n] = 1;
    for (int i = n - 1; i >= 0; --i) {
        int x = lower_bound(ALL(s), pair<ll, ll>(s[i].first + s[i].second, 0)) - s.begin();
        ST.update(i, max(x, ST.get(i + 1, x)));
        dp[i] = dp[i + 1] + dp[ST.get(i, i + 1)];
    }
    cout << dp[0] << "\n";
    return 0;
}


Measured memory_bytes: 9936