#include <bits/stdc++.h>

using namespace std;

const int INF = 2e9 + 9;
const long long MOD = 998244353;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    vector<pair<int, int>> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i].first >> a[i].second;
    }
    sort(a.begin(), a.end());
    vector<pair<int, long long>> st = {{INF, 1}};
    for (int i = n-1; i >= 0; i--) {
        auto cur = st.back().second;
        auto to = a[i].first + a[i].second;
        while (st.back().first < to) {
            st.pop_back();
        }
        cur = (cur + st.back().second) % MOD;
        st.push_back({a[i].first, cur});
    }
    cout << st.back().second << endl;
}

