#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll inf=1744174417441744;
ll par[200005]={0};
ll dp[200005]={0};
int main(){
  vector<P> vec;
  ll n;
  cin>>n;
  for(int i=0;i<n;i++){
    ll x,d;
    cin>>x>>d;
    vec.push_back(P(x,d));
  }
  sort(vec.begin(),vec.end());
  vector<P> v2;
  for(int i=0;i<n;i++) v2.push_back(P(vec[i].first+vec[i].second,i));
  sort(v2.begin(),v2.end());
  ll rpos=n-1;
  multiset<ll> ms;
  for(int i=n-1;i>=0;i--){
    while(rpos!=-1&&v2[rpos].first>vec[i].first){
      ms.insert(v2[rpos].second);
      rpos--;
    }
    if(ms.find(i)!=ms.end()) ms.erase(i);
    if(!ms.empty()) par[i]=*ms.rbegin();
    else par[i]=n;
  }
  const ll mod=998244353;
  for(int i=0;i<=n;i++) dp[i]=1;
  for(int i=n-1;i>=0;i--){
    dp[i]++;
    dp[par[i]]*=dp[i];
    dp[par[i]]%=mod;
  }
  cout<<dp[n]<<endl;
}
