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


using ll = long long;
const int MaxN = 2e5;
const int Mod = 998244353;
int N;
vector<pair<int, int>> vxd;


void solve()
{
    sort(vxd.begin(), vxd.end());
    stack<pair<int, int>> st;
    vector<ll> f(N + 1);
    f[N] = 1;
    for (int i = N - 1; i >= 0; i--) {
        int k = i + 1;
        int x = vxd[i].first + vxd[i].second;
        while (!st.empty() && x > vxd[st.top().first].first) {
            k = st.top().second;
            st.pop();
        }
        st.push(make_pair(i, k));
        f[i] = (f[i + 1] + f[k]) % Mod;
    }
    cout << f[0] << endl;
}


int main()
{
    cin >> N;
    vxd.resize(N);
    for (int i = 0; i < N; i++) cin >> vxd[i].first >> vxd[i].second;
    solve();
    return 0;
}
