#include <bits/stdc++.h>
#define ALL(v) std::begin(v), std::end(v)
#define ALLR(v) std::rbegin(v), std::rend(v)
using ll = std::int64_t;
using ull = std::uint64_t;
using pll = std::pair<ll, ll>;
using tll = std::tuple<ll, ll, ll>;
template <typename T> using vec = std::vector<T>;
template <typename T> using vvec = vec<vec<T>>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }
#define mv_rec make_v(init, tail...)
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, size_t s, Tail... tail) { return vec<decltype(mv_rec)>(s, mv_rec); }
#undef mv_rec

namespace math {

template <typename T>
constexpr T pow(const T &n, ll k) {
    T ret = n.mul_id_ele();
    T cur = n;
    while (k) {
        if (k & 1) ret *= cur;
        cur *= cur;
        k /= 2;
    }
    return ret;
}

}

namespace math {

template <ll Mod>
struct Modint {

    constexpr Modint(ll x) : x(x % Mod) { }
    
    constexpr Modint() : Modint(0) { }
    
    constexpr Modint<Mod> add_id_ele() const { 
        return Modint<Mod>(0); 
    }
    
    constexpr Modint<Mod> mul_id_ele() const {
        return Modint<Mod>(1); 
    }
    
    constexpr ll& value() { 
        return x; 
    }
    
    constexpr ll value() const {
        return x; 
    }

    constexpr Modint& operator +=(const Modint &oth) {
        x += oth.value();
        if (Mod <= x) x -= Mod;
        return *this;
    }

    constexpr Modint& operator -=(const Modint &oth) {
        x += Mod - oth.value();
        if (Mod <= x) x -= Mod;
        return *this;
    }

    constexpr Modint& operator *=(const Modint &oth) {
        x *= oth.value();
        x %= Mod;
        return *this;
    }

    constexpr Modint& operator /=(const Modint &oth) {
        x *= oth.inv();
        x %= Mod;
        return *this;
    }

    constexpr Modint operator +(const Modint &oth) const {
        return Modint(x) += oth;
    }

    constexpr Modint operator -(const Modint &oth) const {
        return Modint(x) -= oth;
    }

    constexpr Modint operator *(const Modint &oth) const {
        return Modint(x) *= oth;
    }

    constexpr Modint operator /(const Modint &oth) const {
        return Modint(x) /= oth;
    }

    constexpr Modint operator -() const {
        return Modint((x != 0) * (Mod - x)); 
    }

    template <typename T>
    constexpr typename std::enable_if<std::is_integral<T>::value, const Modint&>::type
    operator =(T t) {
        (*this) = Modint(std::forward<T>(t)); 
        return *this;
    }

    constexpr Modint inv() const {
        return ::math::pow(*this, Mod - 2);
    }

    constexpr ll mod() const {
        return Mod;
    }

private:
    ll x;
};

}

namespace segtree {

template <typename T>
struct SegmentTree {
    using Merge = std::function<T(T, T)>;
    vec<T> nodes;
    Merge merge_f;
    T id_ele;

    SegmentTree(const vec<T> &init_v, Merge merge_f, T id_ele) 
        : nodes(ceil_pow2(init_v.size()) * 2 - 1, id_ele), merge_f(merge_f), id_ele(id_ele)
    {
        ssize_t s = size();
        for (ssize_t i = 0; i < init_v.size(); i++) nodes[i + s - 1] = init_v[i];
        for (ssize_t i = s - 2; 0 <= i; i--) nodes[i] = get_merged(i);
    }

    size_t size() const {
        return (nodes.size() + 1) / 2;
    }

    const T& operator [](ll idx) const {
        return nodes[idx + size() - 1];
    }

    T get_query(ll ql, ll qr, ll nl, ll nr, ll nidx) const {
        if (nr <= ql || qr <= nl) return id_ele;
        if (ql <= nl && nr <= qr) return nodes[nidx];
        ll mid = (nl + nr) / 2;
        ll lidx, ridx;
        std::tie(lidx, ridx) = get_children_idx(nidx);
        auto lv = get_query(ql, qr, nl, mid, lidx);
        auto rv = get_query(ql, qr, mid, nr, ridx);
        return merge_f(lv, rv);
    }

    T get_query(ll ql, ll qr) const {
        return get_query(ql, qr, 0, size(), 0);
    }

    void update_query(ll idx, T val) {
        idx += size() - 1;
        nodes[idx] = val;
        while (idx) {
            ll pidx = (idx - 1) / 2;
            nodes[pidx] = get_merged(pidx);
            idx = pidx;
        }
    }

    // FIXME : test
    T lower_bound(ll idx, std::function<bool(T)> check, T sum) const {
        if (size() - 1 <= idx) return idx - (size() - 1);
        ll lidx, ridx;
        std::tie(lidx, ridx) = get_children_idx(idx);
        auto lv = merge_f(sum, nodes[lidx]);
        if (check(lv)) return lower_bound(lidx, check, sum);
        else return lower_bound(ridx, check, lv);
    }

    T lower_bound(std::function<bool(T)> check) const {
        return lower_bound(0, check, id_ele);
    }

private:
    ssize_t ceil_pow2(ssize_t s) {
        ssize_t ret = 1;
        while (ret <= s) ret *= 2;
        return ret;
    }

    pll get_children_idx(ll idx) const {
        return pll(2 * idx + 1, 2 * idx + 2);
    }

    T get_merged(ll idx) const {
        ll a, b;
        std::tie(a, b) = get_children_idx(idx);
        return merge_f(nodes[a], nodes[b]);
    }
};

}

const ll inf = 5e15;
const ll mod = 998244353;
using mint = math::Modint<mod>;

int main() {
    ll n;
    std::cin >> n;
    vec<pll> xd(n);
    for (ll i = 0; i < n; i++) {
        ll x, d;
        std::cin >> x >> d;
        xd[i] = pll(x, d);
    }
    
    std::sort(ALL(xd));
    vec<ll> init_v(n + 10), xv(n + 1, inf);
    for (ll i = 0; i < n; i++) {
        ll x, d;
        std::tie(x, d) = xd[i];
        init_v[i] = x + d;
        xv[i] = x;
    }

    vec<mint> dp(n + 1, 0);
    dp.back() = 1;
    segtree::SegmentTree<ll> seg(vec<ll>(n + 10, -inf), [](ll a, ll b) { return std::max(a, b); }, -inf);
    seg.update_query(n, n);
    for (ll i = n - 1; 0 <= i; i--) {
        ll x, d;
        std::tie(x, d) = xd[i];
        auto ite = std::lower_bound(ALL(xv), x + d) - 1;
        ll idx = std::distance(xv.begin(), ite);
        if (idx == i) {
            seg.update_query(i, i);
            dp[i] = dp[i + 1] * 2;
        } else {
            ll maxv = seg.get_query(i + 1, idx + 1);
            seg.update_query(i, maxv);
            dp[i] += dp[maxv + 1];
            dp[i] += dp[i + 1];
        }
    }

    std::cout << dp[0].value() << '\n';
    return 0;
}


Measured memory_bytes: 13696