#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(a) (a).begin(), (a).end()

typedef long long ll;
typedef pair<int, int> pii;

const ll inf = 2e9, mod = 998244353;

int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    int n; cin >> n;
    vector<pair<ll, ll>> robot(n + 1);
    vector<ll> dp(n + 1);
    for (int i = 0; i < n; ++i) {
        cin >> robot[i].first >> robot[i].second;
    }

    robot[n] = make_pair(inf, inf);
    sort(all(robot));
    dp[n] = 1;
    vector<int> st = {n};

    for (int i = n - 1; i >= 0; --i) {
        ll gor = robot[i].first + robot[i].second;
        while (!st.empty() && robot[st.back()].first < gor) 
            st.pop_back();

        dp[i] = (dp[i] + dp[i + 1] + dp[st.back()]) % mod;
        st.push_back(i);
    }

    cout << dp[0] << '\n';

}