#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define debug(...) cerr<<__LINE__<<" ["<<#__VA_ARGS__<<"]:",debug_out(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec)
{ for (auto v : vec) os << v << ' '; os << '\n'; return os; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa)
{ os << '(' << pa.first << ',' << pa.second << ')'; return os; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T)
{ cerr << " " << H; debug_out(T...); }
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; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

template <unsigned int mod>
struct ModInt {
    ll x;
    ModInt() : x(0) {}
    ModInt(ll y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
    ModInt &operator+=(const ModInt &p) { if((x += p.x) >= mod) x -= mod; return *this; }
    ModInt &operator-=(const ModInt &p) { if((x += mod - p.x) >= mod) x -= mod; return *this; }
    ModInt &operator*=(const ModInt &p) { x = (int) (1LL * x * p.x % mod); return *this; }
    ModInt &operator/=(const ModInt &p) { *this *= p.inverse(); return *this; }
    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }
    ModInt pow(int64_t n) const {
        ModInt ret(1), mul(x);
        while(n > 0) {
            if(n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }
    ModInt inverse() const { return pow(mod - 2); }
    friend ostream &operator<<(ostream &os, const ModInt &p) {
        return os << p.x;
    }
};

template<typename T>
struct SegmentTree {
    using F = function<T(T, T)>;
private:
    int n;
    vector<T> data;
    const F f;
    const T e;

    T _query(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) return e;
        if (a <= l && r <= b) return data[k];

        T vl = _query(a, b, 2 * k + 1, l, (l + r) / 2);
        T vr = _query(a, b, 2 * k + 2, (l + r) / 2, r);

        return f(vl, vr);
    }

public:
    SegmentTree(int _n, F f, T e)
    : f(f), e(e) {
        n = 1;
        while(n < _n) n <<= 1;
        data.assign(2 * n - 1, e);
    }

    void setup() {
        for (int i = n - 2; i >= 0; i--) {
            data[i] = f(data[2 * i + 1], data[2 * i + 2]);
        }
    }

    void update(int i, int x) {
        i += n - 1;
        data[i] = x;
        while(i > 0) {
            i = (i - 1) / 2;
            data[i] = f(data[2 * i + 1], data[2 * i + 2]);
        }
    }

    T query(int a, int b) {
        return _query(a, b, 0, 0, n);
    }

    const T &operator[](const int &i) {
        return data[i + n - 1];
    }
};

const int mod = 998244353;
using mint = ModInt<mod>;

mint dp[201010];

void solve() {
    int n;
    cin >> n;
    vector<pll> R(n);
    rep(i, n) {
        ll x, d;
        cin >> x >> d;
        R[i] = {x, d};
    }
    sort(all(R));
    auto _max = [](int a, int b) {return max(a, b);};
    SegmentTree<int> st(n, _max, 0);
    st.setup();
    for (int i = n - 1; i >= 0; i--) {
        st.update(i, i);
    }
    for (int i = n - 1; i >= 0; i--) {
        pll x = {R[i].fi + R[i].se, -1};
        int idx = lower_bound(all(R), x) - R.begin();
        int m = st.query(i, idx);
        st.update(i, m);
    }
    dp[0] = 1;
    rep(i, n) {
        int j = st.query(i, i + 1);
        dp[i + 1] += dp[i];
        dp[j + 1] += dp[i];
    }
    cout << dp[n] << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}


Measured memory_bytes: 10076