package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "sort"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func SumInt(A ...int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}
func AbsInt(x int) int {
  if x < 0 { x = -x }
  return x
}

func Mod(I []int, P int) int {
  N := 0
  for _, i := range I {
    N = N * 10 + i
    N %= P
  }
  return N
}

type Evaluator func(a, b interface{}) interface{}
func Eval(a, b interface{}) interface{} {
  x := a.(int)
  y := b.(int)
  if x < y { return y }
  return x
} 
type SegmentTree struct {
  size  int
  data  []interface{}
  inf   interface{}
  eval  Evaluator
}
func InitSegmentTree(N int, inf interface{}, eval Evaluator) *SegmentTree {
  size := 1
  for size < N {
    size *= 2
  }
  S := make([]interface{}, size * 2)
  for i := range S {
    S[i] = inf
  }
  return &SegmentTree{
    size: size,
    data: S,
    inf:  inf,
    eval: eval,
  }
}
func CreateSegmentTree(A *[]interface{}, inf interface{}, eval Evaluator) *SegmentTree {
  N := len((*A))
  size := 1
  for size < N {
    size *= 2
  }
  S := make([]interface{}, size * 2)
  for i, a := range (*A) {
    S[size + i] = a
  }
  for i := N; i < size; i++ {
    S[size + i] = inf
  }
  for i := size - 1; i > 0; i-- {
    S[i] = eval(S[2 * i], S[2 * i + 1])
  }
  return &SegmentTree{
    size: size,
    data: S,
    inf:  inf,
    eval: eval,
  }
}
func (ST *SegmentTree) Update(index int, value interface{}) {
  idx := ST.size + index
  ST.data[idx] = value
  for idx > 1 {
    parent := idx / 2
    ST.data[parent] = ST.eval(ST.data[2 * parent], ST.data[2 * parent + 1])
    idx = parent
  }
}
func (ST *SegmentTree) Get(from, to, index, left, right int) interface{} {
  // get [from, to)
  if to <= left || right <= from { return ST.inf }
  if from <= left && right <= to { return ST.data[index] }
  m := (left + right) / 2
  lval := ST.Get(from, to, 2 * index, left, m)
  rval := ST.Get(from, to, 2 * index + 1, m, right)
  return ST.eval(lval, rval)
}
func (ST *SegmentTree) Query(from, to int) interface{} {
  return ST.Get(from, to, 1, 0, ST.size)
}

type Robots [][]int
func (R Robots) Len() int { return len(R) }
func (R Robots) Less(i, j int) bool { return R[i][0] < R[j][0] }
func (R Robots) Swap(i, j int) { R[i], R[j] = R[j], R[i] }

func Search(R [][]int, x int) int {
  N := len(R)
  if R[N - 1][0] < x { return N - 1 }
  ltx, gex := 0, N - 1
  for 1 < gex - ltx {
    med := (gex + ltx) / 2
    if R[med][0] < x {
      ltx = med
    } else {
      gex = med
    }
  }
  return ltx
}

const p = 998244353

func Solve() {
  var N int
  NextInt(&N)
  R := make([][]int, N)
  for i := range R {
    NextIntVec(&R[i])
  }
  sort.Sort(Robots(R))
  ST := InitSegmentTree(N, -1, Eval)
  for i := 0; i < N; i++ {
    ST.Update(i, i)
  }
  for i := N - 1; 0 <= i; i-- {
    ST.Update(i, ST.Query(i, Search(R, R[i][0] + R[i][1]) + 1).(int))
  }
  DP := make([][]int, N + 1)
  DP[N] = []int{1, 0}
  for i := N - 1; 0 <= i; i-- {
    DP[i] = make([]int, 2)
    DP[i][0] = (DP[i + 1][0] + DP[i + 1][1]) % p
    r := ST.Query(i, i + 1).(int) + 1
    DP[i][1] = (DP[r][0] + DP[r][1]) % p
  }
  Write(SumInt(DP[0]...) % p)
}

func main() {
  Solve()
  Output()
}

Measured memory_bytes: 50944