#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...) 0
#endif

template <ll mod>
struct modular {
    ll value;
    modular(ll x = 0) {
        value = x % mod;
        if (value < 0) value += mod;
    }
    modular& operator+=(modular other) {
        if ((value += other.value) >= mod) value -= mod;
        return *this;
    }
    modular& operator-=(modular other) {
        if ((value -= other.value) < 0) value += mod;
        return *this;
    }
    modular& operator*=(modular other) {
        value = value * other.value % mod;
        return *this;
    }
    modular& operator/=(modular other) {
        ll a = 0, b = 1, c = other.value, m = mod;
        while (c != 0) {
            ll t = m / c;
            m -= t * c;
            swap(c, m);
            a -= t * b;
            swap(a, b);
        }
        a %= mod;
        if (a < 0) a += mod;
        value = value * a % mod;
        return *this;
    }
    modular& operator^=(modular other) {
        ll r = 1, x = value, n = other.value;
        while (n > 0) {
            if (n & 1) r = r * x % mod;
            x = x * x % mod;
            n >>= 1;
        }
        value = r;
        return *this;
    }
    modular operator+(modular rhs) {
        return modular(*this) += rhs;
    }
    modular operator-(modular rhs) {
        return modular(*this) -= rhs;
    }
    modular operator*(modular rhs) {
        return modular(*this) *= rhs;
    }
    modular operator/(modular rhs) {
        return modular(*this) /= rhs;
    }
    modular operator^(modular rhs) {
        return modular(*this) ^= rhs;
    }
    bool operator==(modular rhs) {
        return value == rhs.value;
    };
    bool operator!=(modular rhs) {
        return value != rhs.value;
    };
    bool operator<(modular rhs) {
        return value < rhs.value;
    }
};
template <ll mod>
string to_string(modular<mod> x) {
    return to_string(x.value);
}
template <ll mod>
ostream& operator<<(ostream& stream, modular<mod> x) {
    x.value %= mod;
    if (x.value < 0) x.value += mod;
    return stream << x.value;
}
template <ll mod>
istream& operator>>(istream& stream, modular<mod>& x) {
    stream >> x.value;
    x.value %= mod;
    if (x.value < 0) x.value += mod;
    return stream;
}
const ll mod = 998244353;
using mint = modular<mod>;

vector<mint> fac, finv;
inline void cinit(int n) {
    fac.resize(n, 1);
    finv.resize(n, 1);
    for (int i = 2; i < n; i++) {
        fac[i] = fac[i - 1] * i;
        finv[i] = finv[i - 1] / i;
    }
}
inline mint C(int n, int k) {
    if (n < k || k < 0 || n < 0) return 0;
    return fac[n] * finv[k] * finv[n - k];
}
inline mint H(int n, int k) {
    return C(n + k - 1, k);
}

template <class T>
struct segtree {
    int n;
    T def = -1e9;
    vector<T> node;
    function<T(T, T)> f = [](int a, int b) { return max(a, b); };

    segtree(int _n) {
        n = 1;
        while (n < _n) n *= 2;
        node.resize(2 * n - 1, def);
    }
    segtree(vector<T> a) {
        n = 1;
        while (n < a.size()) n *= 2;
        node.resize(2 * n - 1, def);
        for (int i = 0; i < a.size(); i++) node[i + n - 1] = a[i];
        for (int i = n - 2; i >= 0; i--)
            node[i] = f(node[2 * i + 1], node[2 * i + 2]);
    }
    inline void update(int k, T v) {
        k += n - 1;
        node[k] = v;  // update
        // ?? node[k] += v;
        while (k > 0) {
            k = (k - 1) / 2;
            node[k] = f(node[2 * k + 1], node[2 * k + 2]);
        }
    }
    inline T get(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) return def;
        if (a <= l && r <= b) return node[k];
        T vl = get(a, b, 2 * k + 1, l, (l + r) / 2);
        T vr = get(a, b, 2 * k + 2, (l + r) / 2, r);
        return f(vl, vr);
    }
    inline T get(int a, int b) {
        return get(a, b, 0, 0, n);
    }
    inline T get(int a) {
        return get(a, a + 1, 0, 0, n);
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    cin >> n;
    vector<pair<ll, ll>> z(n);
    vector<ll> x(n);
    for (int i = 0; i < n; i++) {
        cin >> z[i].first >> z[i].second;
        x[i] = z[i].first;
    }
    sort(z.begin(), z.end());
    sort(x.begin(), x.end());
    vector<int> rc(n);
    for (int i = 0; i < n; i++) {
        rc[i] = lower_bound(x.begin(), x.end(), z[i].first + z[i].second) - x.begin() - 1;
    }
    debug(z);
    debug(rc);
    segtree<int> st(rc);
    for (int i = n - 1; i >= 0; i--) {
        rc[i] = st.get(i, rc[i] + 1);
        st.update(i, rc[i]);
        rc[i]++;
    }
    debug(rc);
    vector<mint> dp(n + 1);
    dp[0] = 1;
    for (int i = 0; i < n; i++) {
        dp[i + 1] += dp[i];
        dp[rc[i]] += dp[i];
    }
    cout << dp[n] << endl;
    return 0;
}

Measured memory_bytes: 9328