#include <iostream>
#include <algorithm>
#include <functional>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>

using namespace std;

const int M = 998244353;
vector<int> to[2000005];

long long dfs(int v) {
  long long res = 1;
  for(int u : to[v]) {
    res = res * dfs(u) % M;
  }
  return (res + 1) % M;
}


int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> p(n);
  for (int i = 0; i < n; ++i) cin >> p[i].first >> p[i].second;
  sort(p.begin(), p.end()); 
  set<pair<int, int>> s;
  
  for (int i = n-1; i >= 0; --i) {
    int x = p[i].first, d = p[i].second;
    while (s.size() && s.begin()->first < x + d) {
      to[i].push_back(s.begin()->second);
      s.erase(s.begin());
    }
    s.emplace(x, i);
  }

  long long ans = 1;
  for (auto r : s) {
    int v = r.second;
    ans = ans * dfs(v) % M;
  }
 
  cout << ans << endl;
  return 0;
}