#[allow(unused_imports)]
use std::char::from_digit;
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::fs::File;
#[allow(unused_imports)]
use std::io::prelude::*;
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufReader, BufWriter, Stdin, Stdout, Write};
#[allow(unused_imports)]
use std::mem::swap;
#[allow(unused_imports)]
use std::str::FromStr;

type BoxResult<T> = Result<T, Box<std::error::Error>>;

const MOD: u64 = 998244353;

fn main() {
    let mut scanner = Scanner::new(stdin());
    let n = scanner.read::<usize>().unwrap();
    let mut coords = vec![];
    for _ in 0..n {
        coords.push(scanner.read_two::<i64, i64>().unwrap());
    }
    coords.sort();
    let ans = solve(n, &coords);
    println!("{}", ans);
}

fn solve(n: usize, coords: &[(i64, i64)]) -> u64 {
    let mut targets = vec![0; n];
    let mut segtree = SegmentTree::new(n);
    segtree.update(n - 1, n - 1);
    targets[n - 1] = n - 1;
    for i in (0..(n - 1)).rev() {
        let end = coords[i].0 + coords[i].1;
        let index = match coords.binary_search_by(|t| t.0.cmp(&end)) {
            Ok(j) => j - 1,
            Err(j) => j - 1,
        };
        if index > i {
            let r = segtree.query(i + 1, index);
            targets[i] = r;
            segtree.update(i, r);
        } else {
            targets[i] = i;
            segtree.update(i, i);
        }
    }
    let mut dp = vec![0; n];
    dp[n - 1] = 2;
    for i in (0..(n - 1)).rev() {
        dp[i] = dp[i + 1];
        if targets[i] != n - 1 {
            dp[i] += dp[targets[i] + 1];
        } else {
            dp[i] += 1;
        }
        dp[i] %= MOD;
    }
    dp[0]
}

struct SegmentTree {
    size: usize,
    values: Vec<usize>,
}

impl SegmentTree {
    fn new(n: usize) -> SegmentTree {
        let mut size = 1;
        while size < n {
            size *= 2;
        }
        let len = 2 * size - 1;
        SegmentTree {
            size: size,
            values: vec![0; len],
        }
    }

    fn update(&mut self, i: usize, x: usize) {
        let size = self.size;
        self.update_rec(0, 0, size - 1, i, x);
    }

    fn update_rec(&mut self, index: usize, l: usize, r: usize, i: usize, x: usize) {
        if l == i && r == i {
            self.values[index] = x;
            return;
        }
        let mid = (l + r) / 2;
        if i <= mid {
            self.update_rec(2 * index + 1, l, mid, i, x);
        } else {
            self.update_rec(2 * index + 2, mid + 1, r, i, x);
        }
        self.values[index] = max(x, self.values[index]);
    }

    fn query(&self, start: usize, end: usize) -> usize {
        self.query_rec(0, 0, self.size - 1, start, end)
    }

    fn query_rec(&self, index: usize, l: usize, r: usize, start: usize, end: usize) -> usize {
        if l == start && r == end {
            return self.values[index];
        }
        let mid = (l + r) / 2;
        if end <= mid {
            self.query_rec(2 * index + 1, l, mid, start, end)
        } else if start > mid {
            self.query_rec(2 * index + 2, mid + 1, r, start, end)
        } else {
            let left = self.query_rec(2 * index + 1, l, mid, start, mid);
            let right = self.query_rec(2 * index + 2, mid + 1, r, mid + 1, end);
            max(left, right)
        }
    }
}

#[allow(dead_code)]
struct Scanner<R> {
    reader: BufReader<R>,
    buffer: String,
}
impl<R> Scanner<R>
where
    R: Read,
{
    #[allow(dead_code)]
    fn new(inner: R) -> Scanner<R> {
        let reader = BufReader::new(inner);
        let buffer = String::new();
        Scanner {
            reader: reader,
            buffer: buffer,
        }
    }
    #[allow(dead_code)]
    fn with_capacity(capacity: usize, inner: R) -> Scanner<R> {
        let reader = BufReader::with_capacity(capacity, inner);
        let buffer = String::new();
        Scanner {
            reader: reader,
            buffer: buffer,
        }
    }
    #[allow(dead_code)]
    fn read_line(&mut self) -> BoxResult<String> {
        self.reader.read_line(&mut self.buffer)?;
        let cloned = self.buffer.trim().to_string();
        self.buffer.clear();
        Ok(cloned)
    }
    #[allow(dead_code)]
    fn read<T>(&mut self) -> BoxResult<T>
    where
        T: FromStr,
        T::Err: std::fmt::Debug,
        T::Err: std::error::Error,
        T::Err: 'static,
    {
        self.reader.read_line(&mut self.buffer)?;
        let parsed = self.buffer.trim().parse()?;
        self.buffer.clear();
        Ok(parsed)
    }
    #[allow(dead_code)]
    fn read_two<T, U>(&mut self) -> BoxResult<(T, U)>
    where
        T: FromStr,
        T: Copy,
        T::Err: std::fmt::Debug,
        T::Err: std::error::Error,
        T::Err: 'static,
        U: FromStr,
        U: Copy,
        U::Err: std::fmt::Debug,
        U::Err: std::error::Error,
        U::Err: 'static,
    {
        self.reader.read_line(&mut self.buffer)?;
        let (a, b) = {
            let params = self.buffer.trim().split_whitespace().collect::<Vec<_>>();
            let a = params[0].parse()?;
            let b = params[1].parse()?;
            (a, b)
        };
        self.buffer.clear();
        Ok((a, b))
    }
    #[allow(dead_code)]
    fn read_three<T>(&mut self) -> BoxResult<(T, T, T)>
    where
        T: FromStr,
        T: Copy,
        T::Err: std::fmt::Debug,
        T::Err: std::error::Error,
        T::Err: 'static,
    {
        let nums = self.read_vector()?;
        Ok((nums[0], nums[1], nums[2]))
    }
    #[allow(dead_code)]
    fn read_vector<T>(&mut self) -> BoxResult<Vec<T>>
    where
        T: FromStr,
        T::Err: std::fmt::Debug,
        T::Err: std::error::Error,
        T::Err: 'static,
    {
        self.reader.read_line(&mut self.buffer)?;
        let parsed_vec = self
            .buffer
            .trim()
            .split_whitespace()
            .map(|s| s.parse())
            .collect::<Result<Vec<_>, _>>()?;
        self.buffer.clear();
        Ok(parsed_vec)
    }
    #[allow(dead_code)]
    fn read_matrix<T>(&mut self, lines: usize) -> BoxResult<Vec<Vec<T>>>
    where
        T: FromStr,
        T::Err: std::fmt::Debug,
        T::Err: std::error::Error,
        T::Err: 'static,
    {
        let mut parsed_matrix = vec![];
        for _ in 0..lines {
            self.reader.read_line(&mut self.buffer)?;
            parsed_matrix.push(
                self.buffer
                    .trim()
                    .split_whitespace()
                    .map(|s| s.parse())
                    .collect::<Result<Vec<_>, _>>()?,
            );
            self.buffer.clear();
        }
        Ok(parsed_matrix)
    }
    #[allow(dead_code)]
    fn read_chars(&mut self) -> BoxResult<Vec<char>> {
        self.reader.read_line(&mut self.buffer)?;
        let chars = self.buffer.trim().chars().collect::<Vec<_>>();
        self.buffer.clear();
        Ok(chars)
    }
}


Measured memory_bytes: 17484