#include <bits/stdc++.h>
using namespace std;
using ll  = long long;
using P   = pair<ll,ll>;
using vp  = vector<P>;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rall(x) (x).rbegin(), (x).rend()
const int mod = 998244353;

int main() {
    ll n; cin >> n;
    vp xd(n);
    rep(i,n) cin>>xd[i].first>>xd[i].second,xd[i].second+=xd[i].first;
    sort(rall(xd));
    vp v;
    for (auto robo : xd) {
        ll r = 1;
        while (v.size() and v.back().first < robo.second and ((r *= v.back().second) %= mod)) v.pop_back();
        v.push_back(P(robo.first, r + 1));
    }
    ll ans = 1;
    for (auto it : v) (ans *= it.second) %= mod;
    cout << ans << endl;
    return 0;
}
