function Main(input) {
    const upperBound = (arr, n) => {
        let first = 0, last = arr.length - 1, middle;
        while (first <= last) {
            middle = Math.floor((first + last) / 2);
            if (arr[middle][0] <= n) first = middle + 1;
            else last = middle - 1;
        }
        return first;
    }
    let C = 998244353;
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    let N = parseInt(input[0][0], 10);
    let arr_XD = [];
    for (let i = 0; i < N; i++){
        arr_XD.push(input[i + 1].map(e => parseInt(e, 10)));
    }
    arr_XD.push([Infinity, 0]); 
    arr_XD.sort((a, b) => b[0] - a[0]);

    arr_XDarise = arr_XD.slice();
    arr_XDarise.sort((a, b) => a[0] - b[0]);
    arr_XDarise.pop();
    // console.log(arr_XDarise);
    let v_ans = [1];
    let uf = new UnionFind(N);
    // console.log(uf.find(0), uf.find(N - 1));
    for (let i = 1; i <= N; i++){
        // console.log("i", i);
        if (arr_XD[i][0] +  arr_XD[i][1] > arr_XD[i - 1][0]){
            // console.log("patternA");
            //二分探索
            let tmp1 = upperBound(arr_XDarise, arr_XD[i][0] +  arr_XD[i][1] - 1); // tmp1までは消す
            // console.log("二分探索→", arr_XD[i][0] +  arr_XD[i][1] - 1 );
            // console.log("tmp1");
            tmp1 = N - tmp1 + 1;
            // console.log(tmp1);
            tmp1 = uf.find(tmp1 - 1) + 1;
            // console.log(tmp1);
            // tmp1 += (uf.size(tmp1 - 1) - 1);
            // console.log(tmp1);

            v_ans.push((v_ans[i - 1] + v_ans[tmp1 - 1]) % C);
            while (tmp1 < i){
                // console.log("?", tmp1);
                tmp2 = uf.find(tmp1) + uf.size(tmp1);
                uf.union(i - 1, tmp1 - 1);
                // tmp1 += 1;
                // console.log(tmp1);
                // console.log(uf.find(tmp1 - 1));
                tmp1 = tmp2;
                // console.log(tmp1);
            }

            // let tmp2 = 1;
            // while (tmp1 < i){
            //     if(uf.find(tmp1 - 1) !== tmp1 - 1) tmp1 = uf.find(tmp1 - 1);
            //     tmp2 = 1 * 
            // }

            // if (uf.find(tmp1 - 1) === tmp1 - 1){ //そいつが独立じゃない場合

            // } else { //そいつが独立な場合


            // }

        } else {
            // console.log("patternB");
            
            v_ans.push(v_ans[i - 1] * 2 % C);
        }
        
        // console.log("ans:", v_ans);
        // if(i >= 1) console.log(uf.find(0), uf.find(1), uf.find(2), uf.find(3), uf.find(4), uf.find(5), uf.find(6), uf.find(7), uf.find(8), uf.find(9) , uf.find(10), uf.find(11));

    }
    console.log(v_ans[v_ans.length - 1]);

}

function UnionFind (n) {
    this.parents = [];
    for (let i = 0; i < n; i++) {
        this.parents.push(-1);
    }
}

UnionFind.prototype.find = function (x) {
    if (this.parents[x] < 0) return x;
    return this.parents[x] = this.find(this.parents[x]);    
}

UnionFind.prototype.union = function (x, y) {
    if (x > y) [x, y] = [y, x];
    x = this.find(x);
    y = this.find(y);
    if (x === y) return;
    if (this.parents[x] > this.parents[y]) [x, y] = [y, x];
    
    this.parents[x] += this.parents[y];
    this.parents[y] = x;
}


UnionFind.prototype.size = function (x) {
    x = this.find(x);
    while (x >= 0) {
        x = this.parents[x];
    }
    return x * -1;
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));
