#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <queue>
#include <stack>
#include <bitset>
#include <set>
#include <chrono>
#include <string>
#include <assert.h>

using namespace std;

#define endl '\n'


int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;

    cin >> n;

    vector<pair<int,int>> a(n + 1);

    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
    }

    a[n] = {-1000000001, 2000000002};

    sort(a.begin(), a.end());

    vector<vector<int>> adj(n + 1);
    vector<int> dp(n + 1, 1);

    vector<int> stk;

    for (int i = n; i >= 0; --i) {
        int to = a[i].first + a[i].second;

        while (!stk.empty() && a[stk.back()].first < to) {
            adj[i].push_back(stk.back());
            stk.pop_back();
        }

        stk.push_back(i);

        for (auto x : adj[i]) {
            dp[i] = 1LL * dp[i] * (dp[x] + 1) % 998244353;
        }

        // cout << dp[i] << endl;
    }

    cout << dp[0] << endl;

    return 0;
}