#include <bits/stdc++.h>
using namespace std ;
const int N = 2e5 + 10 ;
typedef long long ll ;
const int INF = 0x3f3f3f3f ;
constexpr int mod = 998244353 ;
struct Node{

  int x , d ;
}a[N] ;
bool cmp(Node c  ,Node b)
{
  return c.x < b.x ;
}
int main()
{
  int n  ;
  scanf("%d" , &n) ;
  for(int i = 1; i <= n ;i ++)
  scanf("%d%d" , &a[i].x , &a[i].d) ;
  sort(a + 1 , a + n + 1 , cmp) ;
  ll dp = 1 ;
  vector<pair<int , ll>> v ;
  v.push_back({INF , 1}) ;
  for(int i = n ;i >= 1; i --)
   {
     while(a[i].x + a[i].d > v.back().first) v.pop_back() ;
     dp += v.back().second , dp %= mod ;
     v.push_back({a[i].x , dp}) ;
   }
  cout << dp << endl ;
  return 0 ;
}
