#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 998244353;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;

ll modadd(ll x, ll y) {
    return ((x + y) % mod + mod) % mod;
}

ll modminus(ll x, ll y) {
    return (x - y + mod) % mod;
}

ll multiply(ll x, ll y) {
    return (x % mod) * (y % mod) % mod;
}

struct edge {
    ll to, cost;
};

int V;
vector<edge> G[1000000];
ll d[1000000];

void addedge(int st, int ed, ll co) {
    edge e;
    e.to = ed;
    e.cost = co;
    G[st].push_back(e);
}

vector<ll> par;
vector<ll> num;

void leafToRoot(vector<ll> &parentVector, ll root) {
    queue<ll> que;
    num = vector<ll>(V, 1);
    vector<ll> used(parentVector.size());
    fill(used.begin(), used.end(), 0);
    REP(i, 0, parentVector.size()) {
        if (parentVector[i] != -1 && G[i].size() == 1) {
            que.push(i);
            used[i] = 1;
        }
    }
    while (!que.empty()) {
        ll node = que.front();
        que.pop();

        // cout << node << " " << num[node] << "aaa" << endl;
        //rootも含めて子だけのときに何かやりたいときはここに書く
        num[node] = modadd(num[node], 1);

        if (parentVector[node] == -1) {
            continue;
        }
        ll parent = parentVector[node];
        used[parent]++;

        //ここに書く
        num[parent] = multiply(num[parent], num[node]);

        if ((parentVector[parent] == -1 && used[parent] == (ll)G[parent].size()) ||
            (parentVector[parent] != -1 && used[parent] == (ll)G[parent].size() - 1)) {
            que.push(parent);
        }
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    V = N;
    plglg p[N];
    REP(i, 0, N) {
        ll x, d;
        cin >> x >> d;
        p[i] = plglg(x, d);
    }
    sort(p, p + N);
    stack<plglg> st;
    par = vector<ll>(N, -1);
    PER(i, N - 1, -1) {
        plglg pt = p[i];
        while (!st.empty()) {
            plglg tp = st.top();
            if (tp.first < pt.first + pt.second) {
                par[tp.second] = i;
                addedge(tp.second, i, 0);
                addedge(i, tp.second, 0);
                st.pop();
            } else {
                break;
            }
        }
        st.push(plglg(pt.first, i));
    }
    leafToRoot(par, 0);
    ll ans = 1;
    REP(i, 0, N) {
        if (par[i] == -1) {
            if (G[i].size() == 0) {
                num[i] = modadd(num[i], 1);
            }
            // cout << i << " " << num[i] << endl;
            ans = multiply(ans, num[i]);
        }
    }
    // REP(i, 0, N) {
    //     cout << par[i] << " ";
    // }
    // cout << endl;
    cout << ans << endl;
}


Measured memory_bytes: 43008